-
Notifications
You must be signed in to change notification settings - Fork 3
/
rdrcorr.f90
69 lines (56 loc) · 2.77 KB
/
rdrcorr.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
subroutine rdrcorr
!---------------------------------------------------------------------------
! !
! Copyright 2015 Anna teruzzi, OGS Trieste !
! !
! This file is part of 3DVarBio.
! 3DVarBio is based on OceanVar (Dobricic, 2006) !
! !
! 3DVarBio is free software: you can redistribute it and/or modify. !
! it under the terms of the GNU General Public License as published by !
! the Free Software Foundation, either version 3 of the License, or !
! (at your option) any later version. !
! !
! 3DVarBio is distributed in the hope that it will be useful, !
! but WITHOUT ANY WARRANTY; without even the implied warranty of !
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the !
! GNU General Public License for more details. !
! !
! You should have received a copy of the GNU General Public License !
! along with OceanVar. If not, see <http://www.gnu.org/licenses/>. !
! !
!---------------------------------------------------------------------------
use set_knd
use drv_str
use grd_str
use cns_str
use filenames
use rcfl
use mpi_str
use pnetcdf
implicit none
integer(i4) :: stat, ncid, idvar
integer(KIND=MPI_OFFSET_KIND) :: GlobalStart(3), GlobalCount(3)
real(r4), ALLOCATABLE :: x3(:,:,:)
!write(*,*)trim(RCORR_FILE)
stat = nf90mpi_open(Var3DCommunicator, trim(RCORR_FILE), NF90_NOWRITE, MPI_INFO_NULL, ncid)
if (stat /= nf90_noerr) call handle_err("nf90mpi_open",stat)
ALLOCATE ( x3(GlobalRow,GlobalCol,grd%km))
GlobalStart(:) = 1
GlobalCount(1) = GlobalRow
GlobalCount(2) = GlobalCol
GlobalCount(3) = grd%km
stat = nf90mpi_inq_varid (ncid, 'radius', idvar)
if (stat /= nf90_noerr) call handle_err("nf90mpi_inq_varid radius",stat)
stat = nfmpi_get_vara_real_all (ncid, idvar, GlobalStart, GlobalCount, x3)
if (stat /= nf90_noerr) call handle_err("nfmpi_get_vara_real_all radius",stat)
rcf%Lxyz(:,:,:) = x3(:,:,:)
!laura from km to meter
where (rcf%Lxyz<=0.0001)
rcf%Lxyz=rcf%Lxyz/1000
end where
rcf%Lxyz= rcf%Lxyz*1000 !from km to meter
stat = nf90mpi_close(ncid)
if (stat /= nf90_noerr) call handle_err("nf90mpi_close", stat)
DEALLOCATE(x3)
end subroutine rdrcorr