[3522] | 1 | module writediagsoil_mod |
---|
| 2 | |
---|
| 3 | implicit none |
---|
| 4 | |
---|
| 5 | contains |
---|
| 6 | |
---|
[135] | 7 | subroutine writediagsoil(ngrid,name,title,units,dimpx,px) |
---|
| 8 | |
---|
| 9 | ! Write variable 'name' to NetCDF file 'diagsoil.nc'. |
---|
| 10 | ! The variable may be 3D (lon,lat,depth) subterranean field, |
---|
| 11 | ! a 2D (lon,lat) surface field, or a simple scalar (0D variable). |
---|
| 12 | ! |
---|
| 13 | ! Calls to 'writediagsoil' can originate from anywhere in the program; |
---|
| 14 | ! An initialisation of variable 'name' is done if it is the first time |
---|
| 15 | ! that this routine is called with given 'name'; otherwise data is appended |
---|
| 16 | ! (yielding the sought time series of the variable) |
---|
| 17 | |
---|
[1216] | 18 | ! Modifs: Aug.2010 Ehouarn: enforce outputs to be real*4 |
---|
| 19 | |
---|
[1529] | 20 | use comsoil_h, only: nsoilmx, inertiedat |
---|
[1543] | 21 | use geometry_mod, only: cell_area |
---|
[1525] | 22 | use time_phylmdz_mod, only: ecritphy, day_step, iphysiq |
---|
[965] | 23 | use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather |
---|
[1529] | 24 | use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo, & |
---|
| 25 | nbp_lon, nbp_lat |
---|
[787] | 26 | |
---|
[135] | 27 | implicit none |
---|
| 28 | |
---|
[1529] | 29 | include"netcdf.inc" |
---|
[135] | 30 | |
---|
| 31 | ! Arguments: |
---|
| 32 | integer,intent(in) :: ngrid ! number of (horizontal) points of physics grid |
---|
| 33 | ! i.e. ngrid = 2+(jjm-1)*iim - 1/jjm |
---|
| 34 | character(len=*),intent(in) :: name ! 'name' of the variable |
---|
| 35 | character(len=*),intent(in) :: title ! 'long_name' attribute of the variable |
---|
| 36 | character(len=*),intent(in) :: units ! 'units' attribute of the variable |
---|
| 37 | integer,intent(in) :: dimpx ! dimension of the variable (3,2 or 0) |
---|
| 38 | real,dimension(ngrid,nsoilmx),intent(in) :: px ! variable |
---|
| 39 | |
---|
| 40 | ! Local variables: |
---|
[1529] | 41 | real*4,dimension(nbp_lon+1,nbp_lat,nsoilmx) :: data3 ! to store 3D data |
---|
| 42 | real*4,dimension(nbp_lon+1,nbp_lat) :: data2 ! to store 2D data |
---|
[1216] | 43 | real*4 :: data0 ! to store 0D data |
---|
[1531] | 44 | real*4 :: data3_1d(1,nsoilmx) ! to store a profile in 1D model |
---|
| 45 | real*4 :: data2_1d ! to store surface value with 1D model |
---|
[135] | 46 | integer :: i,j,l ! for loops |
---|
| 47 | integer :: ig0 |
---|
| 48 | |
---|
[1216] | 49 | real*4,save :: date ! time counter (in elapsed days) |
---|
[1529] | 50 | |
---|
| 51 | real :: inertia((nbp_lon+1),nbp_lat,nsoilmx) |
---|
| 52 | real :: area((nbp_lon+1),nbp_lat) |
---|
| 53 | |
---|
| 54 | real :: inertiafi_glo(klon_glo,nsoilmx) |
---|
| 55 | real :: areafi_glo(klon_glo) |
---|
| 56 | |
---|
[135] | 57 | integer,save :: isample ! sample rate at which data is to be written to output |
---|
| 58 | integer,save :: ntime=0 ! counter to internally store time steps |
---|
| 59 | character(len=20),save :: firstname="1234567890" |
---|
| 60 | integer,save :: zitau=0 |
---|
[1315] | 61 | !$OMP THREADPRIVATE(date,isample,ntime,firstname,zitau) |
---|
[135] | 62 | |
---|
| 63 | character(len=30) :: filename="diagsoil.nc" |
---|
| 64 | |
---|
| 65 | ! NetCDF stuff: |
---|
| 66 | integer :: nid ! NetCDF output file ID |
---|
| 67 | integer :: varid ! NetCDF ID of a variable |
---|
| 68 | integer :: ierr ! NetCDF routines return code |
---|
| 69 | integer,dimension(4) :: id ! NetCDF IDs of the dimensions of the variable |
---|
| 70 | integer,dimension(4) :: edges,corners |
---|
| 71 | |
---|
[965] | 72 | #ifdef CPP_PARA |
---|
| 73 | ! Added to work in parallel mode |
---|
| 74 | real dx3_glop(klon_glo,nsoilmx) |
---|
[1529] | 75 | real dx3_glo(nbp_lon,nbp_lat,nsoilmx) ! to store a global 3D data set |
---|
[965] | 76 | real dx2_glop(klon_glo) |
---|
[1529] | 77 | real dx2_glo(nbp_lon,nbp_lat) ! to store a global 2D (surface) data set |
---|
[965] | 78 | real px2(ngrid) |
---|
| 79 | #endif |
---|
| 80 | |
---|
[135] | 81 | ! 1. Initialization step |
---|
| 82 | if (firstname.eq."1234567890") then |
---|
| 83 | ! Store 'name' as 'firstname' |
---|
| 84 | firstname=name |
---|
| 85 | ! From now on, if 'name'.eq.'firstname', then it is a new time cycle |
---|
| 86 | |
---|
| 87 | ! just to be sure, check that firstnom is large enough to hold nom |
---|
| 88 | if (len_trim(firstname).lt.len_trim(name)) then |
---|
| 89 | write(*,*) "writediagsoil: Error !!!" |
---|
| 90 | write(*,*) " firstname string not long enough!!" |
---|
| 91 | write(*,*) " increase its size to at least ",len_trim(name) |
---|
| 92 | stop |
---|
| 93 | endif |
---|
[3522] | 94 | |
---|
[135] | 95 | ! Set output sample rate |
---|
[1529] | 96 | isample=int(ecritphy) ! same as for diagfi outputs |
---|
[135] | 97 | ! Note ecritphy is known from control.h |
---|
[3522] | 98 | |
---|
[135] | 99 | ! Create output NetCDF file |
---|
[965] | 100 | if (is_master) then |
---|
| 101 | ierr=NF_CREATE(filename,NF_CLOBBER,nid) |
---|
| 102 | if (ierr.ne.NF_NOERR) then |
---|
[135] | 103 | write(*,*)'writediagsoil: Error, failed creating file '//trim(filename) |
---|
| 104 | stop |
---|
[965] | 105 | endif |
---|
[1529] | 106 | |
---|
| 107 | #ifdef CPP_PARA |
---|
| 108 | ! Gather inertiedat() soil thermal inertia on physics grid |
---|
| 109 | call Gather(inertiedat,inertiafi_glo) |
---|
[1542] | 110 | ! Gather cell_area() mesh area on physics grid |
---|
| 111 | call Gather(cell_area,areafi_glo) |
---|
[1529] | 112 | #else |
---|
| 113 | inertiafi_glo(:,:)=inertiedat(:,:) |
---|
[1542] | 114 | areafi_glo(:)=cell_area(:) |
---|
[1529] | 115 | #endif |
---|
| 116 | |
---|
| 117 | ! build inertia() and area() |
---|
[1531] | 118 | if (klon_glo>1) then |
---|
| 119 | do i=1,nbp_lon+1 ! poles |
---|
[1529] | 120 | inertia(i,1,1:nsoilmx)=inertiafi_glo(1,1:nsoilmx) |
---|
| 121 | inertia(i,nbp_lat,1:nsoilmx)=inertiafi_glo(klon_glo,1:nsoilmx) |
---|
| 122 | ! for area, divide at the poles by nbp_lon |
---|
| 123 | area(i,1)=areafi_glo(1)/nbp_lon |
---|
| 124 | area(i,nbp_lat)=areafi_glo(klon_glo)/nbp_lon |
---|
[1531] | 125 | enddo |
---|
| 126 | do j=2,nbp_lat-1 |
---|
[1529] | 127 | ig0= 1+(j-2)*nbp_lon |
---|
| 128 | do i=1,nbp_lon |
---|
| 129 | inertia(i,j,1:nsoilmx)=inertiafi_glo(ig0+i,1:nsoilmx) |
---|
| 130 | area(i,j)=areafi_glo(ig0+i) |
---|
| 131 | enddo |
---|
| 132 | ! handle redundant point in longitude |
---|
| 133 | inertia(nbp_lon+1,j,1:nsoilmx)=inertia(1,j,1:nsoilmx) |
---|
| 134 | area(nbp_lon+1,j)=area(1,j) |
---|
[1531] | 135 | enddo |
---|
| 136 | endif |
---|
[3522] | 137 | |
---|
[1529] | 138 | ! write "header" of file (longitudes, latitudes, geopotential, ...) |
---|
[1531] | 139 | if (klon_glo>1) then ! general 3D case |
---|
| 140 | call iniwritesoil(nid,ngrid,inertia,area,nbp_lon+1,nbp_lat) |
---|
| 141 | else ! 1D model |
---|
| 142 | call iniwritesoil(nid,ngrid,inertiafi_glo(1,:),areafi_glo(1),1,1) |
---|
| 143 | endif |
---|
[1529] | 144 | |
---|
[965] | 145 | endif ! of if (is_master) |
---|
[3522] | 146 | |
---|
[135] | 147 | ! set zitau to -1 to be compatible with zitau incrementation step below |
---|
| 148 | zitau=-1 |
---|
[3522] | 149 | |
---|
[135] | 150 | else |
---|
| 151 | ! If not an initialization call, simply open the NetCDF file |
---|
[965] | 152 | if (is_master) then |
---|
| 153 | ierr=NF_OPEN(filename,NF_WRITE,nid) |
---|
| 154 | endif |
---|
[135] | 155 | endif ! of if (firstname.eq."1234567890") |
---|
| 156 | |
---|
| 157 | ! 2. Increment local time counter, if necessary |
---|
| 158 | if (name.eq.firstname) then |
---|
| 159 | ! if we run across 'firstname', then it is a new time step |
---|
| 160 | zitau=zitau+iphysiq |
---|
| 161 | ! Note iphysiq is known from control.h |
---|
| 162 | endif |
---|
| 163 | |
---|
| 164 | ! 3. Write data, if the time index matches the sample rate |
---|
| 165 | if (mod(zitau+1,isample).eq.0) then |
---|
| 166 | |
---|
| 167 | ! 3.1 If first call at this date, update 'time' variable |
---|
| 168 | if (name.eq.firstname) then |
---|
| 169 | ntime=ntime+1 |
---|
| 170 | date=float(zitau+1)/float(day_step) |
---|
| 171 | ! Note: day_step is known from control.h |
---|
[3522] | 172 | |
---|
[965] | 173 | if (is_master) then |
---|
| 174 | ! Get NetCDF ID for "time" |
---|
| 175 | ierr=NF_INQ_VARID(nid,"time",varid) |
---|
| 176 | ! Add the current value of date to the "time" array |
---|
[1216] | 177 | !#ifdef NC_DOUBLE |
---|
| 178 | ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,ntime,1,date) |
---|
| 179 | !#else |
---|
[965] | 180 | ierr=NF_PUT_VARA_REAL(nid,varid,ntime,1,date) |
---|
[1216] | 181 | !#endif |
---|
[965] | 182 | if (ierr.ne.NF_NOERR) then |
---|
[135] | 183 | write(*,*)"writediagsoil: Failed writing date to time variable" |
---|
[3522] | 184 | stop |
---|
[965] | 185 | endif |
---|
| 186 | endif ! of if (is_master) |
---|
[135] | 187 | endif ! of if (name.eq.firstname) |
---|
| 188 | |
---|
| 189 | ! 3.2 Write the variable to the NetCDF file |
---|
| 190 | if (dimpx.eq.3) then ! Case of a 3D variable |
---|
| 191 | ! A. Recast data along 'dynamics' grid |
---|
[965] | 192 | #ifdef CPP_PARA |
---|
| 193 | ! gather field on a "global" (without redundant longitude) array |
---|
| 194 | call Gather(px,dx3_glop) |
---|
| 195 | !$OMP MASTER |
---|
| 196 | if (is_mpi_root) then |
---|
| 197 | call Grid1Dto2D_glo(dx3_glop,dx3_glo) |
---|
| 198 | ! copy dx3_glo() to dx3(:) and add redundant longitude |
---|
[1529] | 199 | data3(1:nbp_lon,:,:)=dx3_glo(1:nbp_lon,:,:) |
---|
| 200 | data3(nbp_lon+1,:,:)=data3(1,:,:) |
---|
[965] | 201 | endif |
---|
| 202 | !$OMP END MASTER |
---|
| 203 | !$OMP BARRIER |
---|
| 204 | #else |
---|
[1531] | 205 | if (klon_glo>1) then ! General case |
---|
| 206 | do l=1,nsoilmx |
---|
[135] | 207 | ! handle the poles |
---|
[1529] | 208 | do i=1,nbp_lon+1 |
---|
[135] | 209 | data3(i,1,l)=px(1,l) |
---|
[1529] | 210 | data3(i,nbp_lat,l)=px(ngrid,l) |
---|
[135] | 211 | enddo |
---|
| 212 | ! rest of the grid |
---|
[1529] | 213 | do j=2,nbp_lat-1 |
---|
| 214 | ig0=1+(j-2)*nbp_lon |
---|
| 215 | do i=1,nbp_lon |
---|
[135] | 216 | data3(i,j,l)=px(ig0+i,l) |
---|
| 217 | enddo |
---|
[1529] | 218 | data3(nbp_lon+1,j,l)=data3(1,j,l) ! extra (modulo) longitude |
---|
[135] | 219 | enddo |
---|
[1531] | 220 | enddo |
---|
| 221 | else ! 1D model case |
---|
| 222 | data3_1d(1,1:nsoilmx)=px(1,1:nsoilmx) |
---|
| 223 | endif |
---|
[965] | 224 | #endif |
---|
[3522] | 225 | |
---|
[135] | 226 | ! B. Write (append) the variable to the NetCDF file |
---|
[965] | 227 | if (is_master) then |
---|
[135] | 228 | ! B.1. Get the ID of the variable |
---|
| 229 | ierr=NF_INQ_VARID(nid,name,varid) |
---|
| 230 | if (ierr.ne.NF_NOERR) then |
---|
| 231 | ! If we failed geting the variable's ID, we assume it is because |
---|
| 232 | ! the variable doesn't exist yet and must be created. |
---|
| 233 | ! Start by obtaining corresponding dimensions IDs |
---|
| 234 | ierr=NF_INQ_DIMID(nid,"longitude",id(1)) |
---|
| 235 | ierr=NF_INQ_DIMID(nid,"latitude",id(2)) |
---|
| 236 | ierr=NF_INQ_DIMID(nid,"depth",id(3)) |
---|
| 237 | ierr=NF_INQ_DIMID(nid,"time",id(4)) |
---|
| 238 | ! Tell the world about it |
---|
| 239 | write(*,*) "=====================" |
---|
| 240 | write(*,*) "writediagsoil: creating variable "//trim(name) |
---|
| 241 | call def_var(nid,name,title,units,4,id,varid,ierr) |
---|
| 242 | endif ! of if (ierr.ne.NF_NOERR) |
---|
[3522] | 243 | |
---|
[135] | 244 | ! B.2. Prepare things to be able to write/append the variable |
---|
| 245 | corners(1)=1 |
---|
| 246 | corners(2)=1 |
---|
| 247 | corners(3)=1 |
---|
| 248 | corners(4)=ntime |
---|
[3522] | 249 | |
---|
[1531] | 250 | if (klon_glo==1) then |
---|
| 251 | edges(1)=1 |
---|
| 252 | else |
---|
| 253 | edges(1)=nbp_lon+1 |
---|
| 254 | endif |
---|
[1529] | 255 | edges(2)=nbp_lat |
---|
[135] | 256 | edges(3)=nsoilmx |
---|
| 257 | edges(4)=1 |
---|
[3522] | 258 | |
---|
[135] | 259 | ! B.3. Write the slab of data |
---|
[1216] | 260 | !#ifdef NC_DOUBLE |
---|
| 261 | ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data3) |
---|
| 262 | !#else |
---|
[1531] | 263 | if (klon_glo>1) then |
---|
| 264 | ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data3) |
---|
| 265 | else |
---|
| 266 | ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data3_1d) |
---|
| 267 | endif |
---|
[1216] | 268 | !#endif |
---|
[135] | 269 | if (ierr.ne.NF_NOERR) then |
---|
| 270 | write(*,*) "writediagsoil: Error: Failed writing "//trim(name)//& |
---|
| 271 | " to file "//trim(filename)//" at time",date |
---|
| 272 | endif |
---|
[965] | 273 | endif ! of if (is_master) |
---|
[135] | 274 | |
---|
| 275 | elseif (dimpx.eq.2) then ! Case of a 2D variable |
---|
[965] | 276 | |
---|
[135] | 277 | ! A. Recast data along 'dynamics' grid |
---|
[965] | 278 | #ifdef CPP_PARA |
---|
| 279 | ! gather field on a "global" (without redundant longitude) array |
---|
| 280 | px2(:)=px(:,1) |
---|
| 281 | call Gather(px2,dx2_glop) |
---|
| 282 | !$OMP MASTER |
---|
| 283 | if (is_mpi_root) then |
---|
| 284 | call Grid1Dto2D_glo(dx2_glop,dx2_glo) |
---|
| 285 | ! copy dx3_glo() to dx3(:) and add redundant longitude |
---|
[1529] | 286 | data2(1:nbp_lon,:)=dx2_glo(1:nbp_lon,:) |
---|
| 287 | data2(nbp_lon+1,:)=data2(1,:) |
---|
[965] | 288 | endif |
---|
| 289 | !$OMP END MASTER |
---|
| 290 | !$OMP BARRIER |
---|
| 291 | #else |
---|
[1531] | 292 | if (klon_glo>1) then ! general case |
---|
| 293 | ! handle the poles |
---|
| 294 | do i=1,nbp_lon+1 |
---|
| 295 | data2(i,1)=px(1,1) |
---|
| 296 | data2(i,nbp_lat)=px(ngrid,1) |
---|
[135] | 297 | enddo |
---|
[1531] | 298 | ! rest of the grid |
---|
| 299 | do j=2,nbp_lat-1 |
---|
| 300 | ig0=1+(j-2)*nbp_lon |
---|
| 301 | do i=1,nbp_lon |
---|
| 302 | data2(i,j)=px(ig0+i,1) |
---|
| 303 | enddo |
---|
| 304 | data2(nbp_lon+1,j)=data2(1,j) ! extra (modulo) longitude |
---|
| 305 | enddo |
---|
| 306 | else ! 1D model case |
---|
| 307 | data2_1d=px(1,1) |
---|
| 308 | endif |
---|
[965] | 309 | #endif |
---|
[135] | 310 | |
---|
| 311 | ! B. Write (append) the variable to the NetCDF file |
---|
[965] | 312 | if (is_master) then |
---|
[135] | 313 | ! B.1. Get the ID of the variable |
---|
| 314 | ierr=NF_INQ_VARID(nid,name,varid) |
---|
| 315 | if (ierr.ne.NF_NOERR) then |
---|
| 316 | ! If we failed geting the variable's ID, we assume it is because |
---|
| 317 | ! the variable doesn't exist yet and must be created. |
---|
| 318 | ! Start by obtaining corresponding dimensions IDs |
---|
| 319 | ierr=NF_INQ_DIMID(nid,"longitude",id(1)) |
---|
| 320 | ierr=NF_INQ_DIMID(nid,"latitude",id(2)) |
---|
| 321 | ierr=NF_INQ_DIMID(nid,"time",id(3)) |
---|
| 322 | ! Tell the world about it |
---|
| 323 | write(*,*) "=====================" |
---|
| 324 | write(*,*) "writediagsoil: creating variable "//trim(name) |
---|
| 325 | call def_var(nid,name,title,units,3,id,varid,ierr) |
---|
| 326 | endif ! of if (ierr.ne.NF_NOERR) |
---|
| 327 | |
---|
| 328 | ! B.2. Prepare things to be able to write/append the variable |
---|
| 329 | corners(1)=1 |
---|
| 330 | corners(2)=1 |
---|
| 331 | corners(3)=ntime |
---|
[3522] | 332 | |
---|
[1531] | 333 | if (klon_glo==1) then |
---|
| 334 | edges(1)=1 |
---|
| 335 | else |
---|
| 336 | edges(1)=nbp_lon+1 |
---|
| 337 | endif |
---|
[1529] | 338 | edges(2)=nbp_lat |
---|
[135] | 339 | edges(3)=1 |
---|
[3522] | 340 | |
---|
[135] | 341 | ! B.3. Write the slab of data |
---|
[1216] | 342 | !#ifdef NC_DOUBLE |
---|
| 343 | ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data2) |
---|
| 344 | !#else |
---|
[1531] | 345 | if (klon_glo>1) then ! General case |
---|
| 346 | ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2) |
---|
| 347 | else |
---|
| 348 | ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2_1d) |
---|
| 349 | endif |
---|
[1216] | 350 | !#endif |
---|
[135] | 351 | if (ierr.ne.NF_NOERR) then |
---|
| 352 | write(*,*) "writediagsoil: Error: Failed writing "//trim(name)//& |
---|
| 353 | " to file "//trim(filename)//" at time",date |
---|
| 354 | endif |
---|
[965] | 355 | endif ! of if (is_master) |
---|
[135] | 356 | |
---|
| 357 | elseif (dimpx.eq.0) then ! Case of a 0D variable |
---|
[965] | 358 | #ifdef CPP_PARA |
---|
| 359 | write(*,*) "writediagsoil: dimps==0 case not implemented in // mode!!" |
---|
| 360 | stop |
---|
| 361 | #endif |
---|
[135] | 362 | ! A. Copy data value |
---|
| 363 | data0=px(1,1) |
---|
| 364 | |
---|
| 365 | ! B. Write (append) the variable to the NetCDF file |
---|
| 366 | ! B.1. Get the ID of the variable |
---|
| 367 | ierr=NF_INQ_VARID(nid,name,varid) |
---|
| 368 | if (ierr.ne.NF_NOERR) then |
---|
| 369 | ! If we failed geting the variable's ID, we assume it is because |
---|
| 370 | ! the variable doesn't exist yet and must be created. |
---|
| 371 | ! Start by obtaining corresponding dimensions IDs |
---|
| 372 | ierr=NF_INQ_DIMID(nid,"time",id(1)) |
---|
| 373 | ! Tell the world about it |
---|
| 374 | write(*,*) "=====================" |
---|
| 375 | write(*,*) "writediagsoil: creating variable "//trim(name) |
---|
| 376 | call def_var(nid,name,title,units,1,id,varid,ierr) |
---|
| 377 | endif ! of if (ierr.ne.NF_NOERR) |
---|
| 378 | |
---|
| 379 | ! B.2. Prepare things to be able to write/append the variable |
---|
| 380 | corners(1)=ntime |
---|
[3522] | 381 | |
---|
[135] | 382 | edges(1)=1 |
---|
| 383 | |
---|
| 384 | ! B.3. Write the data |
---|
[1216] | 385 | !#ifdef NC_DOUBLE |
---|
| 386 | ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data0) |
---|
| 387 | !#else |
---|
[135] | 388 | ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data0) |
---|
[1216] | 389 | !#endif |
---|
[135] | 390 | if (ierr.ne.NF_NOERR) then |
---|
| 391 | write(*,*) "writediagsoil: Error: Failed writing "//trim(name)//& |
---|
| 392 | " to file "//trim(filename)//" at time",date |
---|
| 393 | endif |
---|
| 394 | |
---|
| 395 | endif ! of if (dimpx.eq.3) elseif (dimpx.eq.2) ... |
---|
| 396 | endif ! of if (mod(zitau+1,isample).eq.0) |
---|
| 397 | |
---|
| 398 | ! 4. Close the NetCDF file |
---|
[965] | 399 | if (is_master) then |
---|
| 400 | ierr=NF_CLOSE(nid) |
---|
| 401 | endif |
---|
[135] | 402 | |
---|
| 403 | end subroutine writediagsoil |
---|
[3522] | 404 | |
---|
| 405 | end module writediagsoil_mod |
---|