[2070] | 1 | program readmeteo |
---|
| 2 | |
---|
| 3 | implicit none |
---|
| 4 | include "netcdf.inc" |
---|
| 5 | |
---|
| 6 | !------------------------------------------------------------------------! |
---|
| 7 | ! Readmeteo prepares an initial state for the WPS pre-processor of WRF ! |
---|
| 8 | ! ! |
---|
| 9 | ! Input is a diagfi.nc NETCDF file from a LMD/GCM simulation ! |
---|
| 10 | ! ! |
---|
| 11 | ! Outputs are WRFSI intermediate format files ready for metgrid.exe ! |
---|
| 12 | ! http://www.mmm.ucar.edu/wrf/OnLineTutorial/WPS/IM_si.htm ! |
---|
| 13 | ! ! |
---|
| 14 | ! **** Please create a WPSFEED folder (or a symbolic link) **** ! |
---|
| 15 | ! ! |
---|
| 16 | ! A. Spiga - 16/04/2007 ! |
---|
| 17 | ! 22/05/2007 : need to run zrecast as a preliminary ! |
---|
| 18 | ! 07/06/2007 : external parameter file 'readmeteo.def ! |
---|
| 19 | ! 30/07/2007 : manage additional variables (tsoil, emiss,...) ! |
---|
| 20 | ! 19/10/2007 : no need to run zrecast at all (eta levels) ! |
---|
| 21 | ! 12/2007 : include co2ice and emissivity ! |
---|
| 22 | ! 02/2008 : include water vapor and ice ! |
---|
| 23 | ! 01/2010 : possible use of diagsoil for new physics ! |
---|
| 24 | ! 02/2011 : add dust tracers, correct surface ! |
---|
| 25 | ! ! |
---|
| 26 | ! spiga@lmd.jussieu.fr ! |
---|
| 27 | !------------------------------------------------------------------------! |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | !*************************************************************************** |
---|
| 32 | !*************************************************************************** |
---|
| 33 | REAL, PARAMETER :: emiss_prescribed=0.95 |
---|
| 34 | REAL, PARAMETER :: co2ice_prescribed=0. |
---|
| 35 | CHARACTER (LEN=3), PARAMETER :: ident='LMD' |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | !*************************************************************************** |
---|
| 40 | !*************************************************************************** |
---|
| 41 | |
---|
| 42 | REAL :: ptop |
---|
| 43 | REAL, PARAMETER :: grav=10.5 |
---|
| 44 | LOGICAL, PARAMETER :: blank=.false. |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | !! Variables to be written in the output file |
---|
| 49 | !! *** NB: conformity with metgrid/src/read_met_module.F90 |
---|
| 50 | CHARACTER (LEN=33) :: output |
---|
| 51 | INTEGER :: IFV |
---|
| 52 | CHARACTER (LEN=24) :: HDATE |
---|
| 53 | REAL :: XFCST |
---|
| 54 | CHARACTER (LEN=32) :: SOURCE |
---|
| 55 | CHARACTER (LEN=9) :: FIELD |
---|
| 56 | CHARACTER (LEN=25) :: UNITS |
---|
| 57 | CHARACTER (LEN=46) :: DESC |
---|
| 58 | REAL :: XLVL |
---|
| 59 | INTEGER :: NX,NY,IPROJ |
---|
| 60 | CHARACTER (LEN=8) :: STARTLOC |
---|
| 61 | REAL :: STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 62 | REAL, POINTER, DIMENSION(:,:) :: SLAB |
---|
| 63 | |
---|
| 64 | !! Variables related to NETCDF format |
---|
| 65 | integer :: nid,nid2,nid3,nvarid,ierr,ierr2 |
---|
| 66 | integer :: timedim,londim,latdim,altdim,altdim2 |
---|
| 67 | integer :: rlatvdim,rlonudim |
---|
| 68 | integer :: timelen,lonlen,latlen,altlen,altlen2 |
---|
| 69 | integer :: rlatvlen,rlonulen |
---|
| 70 | integer :: soillen,soildim |
---|
| 71 | integer :: nphys |
---|
| 72 | integer, dimension(4) :: corner,edges |
---|
| 73 | |
---|
| 74 | !! Intermediate data arrays |
---|
| 75 | integer :: k,l,m,n,p |
---|
| 76 | real, dimension(:), allocatable :: lat,lon,time,alt,aps,bps,levels,vertdsoil |
---|
| 77 | real, dimension(:,:), allocatable :: vide,ones,ghtsfile |
---|
| 78 | real, dimension(:,:), allocatable :: interm |
---|
| 79 | real, dimension(:,:,:), allocatable :: gwparam |
---|
| 80 | real, dimension(:,:,:), allocatable :: psfile,tsfile |
---|
| 81 | real, dimension(:,:,:), allocatable :: emissfile,co2icefile |
---|
| 82 | real, dimension(:,:,:), allocatable :: tnsfile,unsfile,vnsfile |
---|
| 83 | real, dimension(:,:,:,:), allocatable :: tfile,ufile,vfile,rfile,hfile |
---|
| 84 | real, dimension(:,:,:,:), allocatable :: eta_gcm |
---|
| 85 | !real, dimension(:,:,:,:), allocatable :: tfileorig,ufileorig,vfileorig |
---|
| 86 | real, dimension(:,:,:,:), allocatable :: tsoilfile, dsoilfile, isoilfile |
---|
| 87 | real, dimension(:,:,:,:), allocatable :: waterfile, watericefile |
---|
| 88 | real, dimension(:,:,:), allocatable :: swatericefile!, swaterfile |
---|
| 89 | real, dimension(:,:,:,:), allocatable :: dustfile,dustnfile |
---|
| 90 | real, dimension(:,:,:,:), allocatable :: co2file |
---|
| 91 | real, dimension(:,:,:,:), allocatable :: ccnfile,ccnnfile |
---|
| 92 | |
---|
| 93 | !! Reading the parameter file |
---|
| 94 | integer :: tmp,increment,FILES |
---|
| 95 | integer :: tmp2,tmp3,tmp4 |
---|
| 96 | character*1 :: answer |
---|
| 97 | character*4 :: str |
---|
| 98 | character*2 :: str2, str3, str4 |
---|
| 99 | integer, dimension(:), allocatable :: time_out |
---|
| 100 | character*13, dimension(:), allocatable :: date_out |
---|
| 101 | character*19, dimension(:), allocatable :: date_out2 |
---|
| 102 | |
---|
| 103 | #ifdef PHOTOCHEM |
---|
| 104 | real, dimension(:,:,:,:,:), allocatable :: chemtrac |
---|
| 105 | integer :: nchemtrac,i |
---|
| 106 | CHARACTER*20,DIMENSION(:),ALLOCATABLE :: wtnom |
---|
| 107 | #endif |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | !*************************************************************************** |
---|
| 111 | !*************************************************************************** |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | !!--------------------- |
---|
| 115 | !! Open the datafile |
---|
| 116 | !!--------------------- |
---|
| 117 | ierr=NF_OPEN ("input_diagfi.nc",NF_NOWRITE,nid) |
---|
| 118 | IF (ierr.NE.NF_NOERR) THEN |
---|
| 119 | write(*,*)'**** Please create a symbolic link called input_diagfi.nc' |
---|
| 120 | CALL ABORT |
---|
| 121 | ENDIF |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | !!-------------------------- |
---|
| 125 | !! Ask for data references |
---|
| 126 | !!-------------------------- |
---|
| 127 | !write(*,*) "Create n files. What is n ?" |
---|
| 128 | read(*,*) FILES |
---|
| 129 | allocate(time_out(FILES)) |
---|
| 130 | allocate(date_out(FILES)) |
---|
| 131 | allocate(date_out2(FILES)) |
---|
| 132 | |
---|
| 133 | !write(*,*) "" |
---|
| 134 | !write(*,*) "INPUT: Diagfi time" |
---|
| 135 | !write(*,*) "list of n subscripts, separated by <Return>s" |
---|
| 136 | increment=1 |
---|
| 137 | do while (increment.ne.FILES+1) |
---|
| 138 | read(*,*) tmp |
---|
| 139 | time_out(increment)=tmp |
---|
| 140 | increment=increment+1 |
---|
| 141 | enddo |
---|
| 142 | |
---|
| 143 | !write(*,*) "" |
---|
| 144 | !write(*,*) "OUTPUT: WRF time" |
---|
| 145 | !write(*,*) "fill 4 lines indicating" |
---|
| 146 | !write(*,*) "-year (4 digits)" |
---|
| 147 | !write(*,*) "-month (2 digits)" |
---|
| 148 | !write(*,*) "-day (2 digits)" |
---|
| 149 | !write(*,*) "-hour (2 digits)" |
---|
| 150 | increment=1 |
---|
| 151 | do while (increment.ne.FILES+1) |
---|
| 152 | read(*,*) str |
---|
| 153 | read(*,*) str2 |
---|
| 154 | read(*,*) str3 |
---|
| 155 | read(*,*) str4 |
---|
| 156 | date_out(increment)=str//'-'//str2//'-'//str3//'_'//str4 |
---|
| 157 | date_out2(increment)=str//'-'//str2//'-'//str3//'_'//str4//':00:00' |
---|
| 158 | !print *,date_out(increment) |
---|
| 159 | !write(*,*) "ok? (y/n)" |
---|
| 160 | read(*,*) answer |
---|
| 161 | if (answer.eq.'n') then |
---|
| 162 | !write(*,*) "please write again" |
---|
| 163 | else |
---|
| 164 | !write(*,*) "next one, please" |
---|
| 165 | increment=increment+1 |
---|
| 166 | endif |
---|
| 167 | enddo |
---|
| 168 | |
---|
| 169 | |
---|
| 170 | !!------------------- |
---|
| 171 | !! Get array sizes |
---|
| 172 | !!------------------- |
---|
| 173 | SELECT CASE(ident) |
---|
| 174 | CASE('LMD') |
---|
| 175 | ierr=NF_INQ_DIMID(nid,"Time",timedim) |
---|
| 176 | CASE('OXF') |
---|
| 177 | ierr=NF_INQ_DIMID(nid,"time",timedim) |
---|
| 178 | END SELECT |
---|
| 179 | ierr=NF_INQ_DIMLEN(nid,timedim,timelen) |
---|
| 180 | write(*,*) "timelen: ",timelen |
---|
| 181 | |
---|
| 182 | SELECT CASE(ident) |
---|
| 183 | CASE('LMD') |
---|
| 184 | ierr=NF_INQ_DIMID(nid,"latitude",latdim) |
---|
| 185 | CASE('OXF') |
---|
| 186 | ierr=NF_INQ_DIMID(nid,"lat",latdim) |
---|
| 187 | END SELECT |
---|
| 188 | ierr=NF_INQ_DIMLEN(nid,latdim,latlen) |
---|
| 189 | write(*,*) "latlen: ",latlen |
---|
| 190 | |
---|
| 191 | SELECT CASE(ident) |
---|
| 192 | CASE('LMD') |
---|
| 193 | ierr=NF_INQ_DIMID(nid,"longitude",londim) |
---|
| 194 | CASE('OXF') |
---|
| 195 | ierr=NF_INQ_DIMID(nid,"lon",londim) |
---|
| 196 | END SELECT |
---|
| 197 | ierr=NF_INQ_DIMLEN(nid,londim,lonlen) |
---|
| 198 | write(*,*) "lonlen: ",lonlen |
---|
| 199 | |
---|
| 200 | SELECT CASE(ident) |
---|
| 201 | CASE('LMD') |
---|
| 202 | ierr=NF_INQ_DIMID(nid,"altitude",altdim) |
---|
| 203 | CASE('OXF') |
---|
| 204 | ierr=NF_INQ_DIMID(nid,"sigma",altdim) |
---|
| 205 | END SELECT |
---|
| 206 | ierr=NF_INQ_DIMLEN(nid,altdim,altlen) |
---|
| 207 | write(*,*) "altlen: ",altlen |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | !!------------------------- |
---|
| 212 | !! Allocate local arrays |
---|
| 213 | !!------------------------- |
---|
| 214 | allocate(eta_gcm(lonlen,latlen,altlen,timelen)) |
---|
| 215 | allocate(tfile(lonlen,latlen,altlen,timelen)) |
---|
| 216 | allocate(tsoilfile(lonlen,latlen,altlen,timelen)) |
---|
| 217 | allocate(dsoilfile(lonlen,latlen,altlen,timelen)) |
---|
| 218 | allocate(isoilfile(lonlen,latlen,altlen,timelen)) |
---|
| 219 | allocate(vertdsoil(altlen)) |
---|
| 220 | !allocate(tfileorig(lonlen,latlen,altlen,timelen)) |
---|
| 221 | allocate(ufile(lonlen,latlen,altlen,timelen)) |
---|
| 222 | !allocate(ufileorig(lonlen,latlen,altlen,timelen)) |
---|
| 223 | allocate(vfile(lonlen,latlen,altlen,timelen)) |
---|
| 224 | !allocate(vfileorig(lonlen,latlen,altlen,timelen)) |
---|
| 225 | allocate(rfile(lonlen,latlen,altlen,timelen)) |
---|
| 226 | allocate(hfile(lonlen,latlen,altlen,timelen)) |
---|
| 227 | allocate(waterfile(lonlen,latlen,altlen,timelen)) |
---|
| 228 | allocate(watericefile(lonlen,latlen,altlen,timelen)) |
---|
| 229 | !allocate(swaterfile(lonlen,latlen,timelen)) |
---|
| 230 | allocate(swatericefile(lonlen,latlen,timelen)) |
---|
| 231 | allocate(dustfile(lonlen,latlen,altlen,timelen)) |
---|
| 232 | allocate(dustnfile(lonlen,latlen,altlen,timelen)) |
---|
| 233 | allocate(co2file(lonlen,latlen,altlen,timelen)) |
---|
| 234 | allocate(ccnfile(lonlen,latlen,altlen,timelen)) |
---|
| 235 | allocate(ccnnfile(lonlen,latlen,altlen,timelen)) |
---|
| 236 | allocate(psfile(lonlen,latlen,timelen)) |
---|
| 237 | allocate(tsfile(lonlen,latlen,timelen)) |
---|
| 238 | allocate(tnsfile(lonlen,latlen,timelen)) |
---|
| 239 | allocate(unsfile(lonlen,latlen,timelen)) |
---|
| 240 | allocate(vnsfile(lonlen,latlen,timelen)) |
---|
| 241 | allocate(emissfile(lonlen,latlen,timelen)) |
---|
| 242 | allocate(co2icefile(lonlen,latlen,timelen)) |
---|
| 243 | allocate(interm(lonlen,latlen)) |
---|
| 244 | allocate(gwparam(lonlen,latlen,5)) |
---|
| 245 | allocate(ghtsfile(lonlen,latlen)) !! no scan axis |
---|
| 246 | allocate(vide(lonlen,latlen)) |
---|
| 247 | allocate(ones(lonlen,latlen)) |
---|
| 248 | allocate(lat(latlen), lon(lonlen), alt(altlen), time(timelen)) |
---|
| 249 | allocate(aps(altlen),bps(altlen),levels(altlen)) |
---|
| 250 | #ifdef PHOTOCHEM |
---|
| 251 | nchemtrac = 14 |
---|
| 252 | allocate(wtnom(nchemtrac)) |
---|
| 253 | wtnom(1) = "c_co2" |
---|
| 254 | wtnom(2) = "c_co" |
---|
| 255 | wtnom(3) = "c_o" |
---|
| 256 | wtnom(4) = "c_o1d" |
---|
| 257 | wtnom(5) = "c_o2" |
---|
| 258 | wtnom(6) = "c_o3" |
---|
| 259 | wtnom(7) = "c_h" |
---|
| 260 | wtnom(8) = "c_h2" |
---|
| 261 | wtnom(9) = "c_oh" |
---|
| 262 | wtnom(10) = "c_ho2" |
---|
| 263 | wtnom(11) = "c_h2o2" |
---|
| 264 | wtnom(12) = "c_ch4" |
---|
| 265 | wtnom(13) = "c_n2" |
---|
| 266 | wtnom(14) = "c_ar" |
---|
| 267 | allocate(chemtrac(lonlen,latlen,altlen,timelen,nchemtrac)) |
---|
| 268 | chemtrac(:,:,:,:,:)=0 |
---|
| 269 | #endif |
---|
| 270 | |
---|
| 271 | tfile(:,:,:,:)=0 |
---|
| 272 | tsoilfile(:,:,:,:)=0 |
---|
| 273 | isoilfile(:,:,:,:)=0 |
---|
| 274 | dsoilfile(:,:,:,:)=0 |
---|
| 275 | vertdsoil(:)=0. |
---|
| 276 | !tfileorig(:,:,:,:)=0 |
---|
| 277 | !ufileorig(:,:,:,:)=0 |
---|
| 278 | !vfileorig(:,:,:,:)=0 |
---|
| 279 | ufile(:,:,:,:)=0 |
---|
| 280 | vfile(:,:,:,:)=0 |
---|
| 281 | rfile(:,:,:,:)=0 |
---|
| 282 | hfile(:,:,:,:)=0 |
---|
| 283 | waterfile(:,:,:,:)=0 |
---|
| 284 | watericefile(:,:,:,:)=0 |
---|
| 285 | !swaterfile(:,:,:)=0 |
---|
| 286 | swatericefile(:,:,:)=0 |
---|
| 287 | dustfile(:,:,:,:)=0 |
---|
| 288 | dustnfile(:,:,:,:)=0 |
---|
| 289 | co2file(:,:,:,:)=0 |
---|
| 290 | ccnfile(:,:,:,:)=0 |
---|
| 291 | ccnnfile(:,:,:,:)=0 |
---|
| 292 | psfile(:,:,:)=0 |
---|
| 293 | tsfile(:,:,:)=0 |
---|
| 294 | emissfile(:,:,:)=0 |
---|
| 295 | co2icefile(:,:,:)=0 |
---|
| 296 | tnsfile(:,:,:)=0 |
---|
| 297 | unsfile(:,:,:)=0 |
---|
| 298 | vnsfile(:,:,:)=0 |
---|
| 299 | interm(:,:)=0 |
---|
| 300 | gwparam(:,:,:)=0 |
---|
| 301 | ghtsfile(:,:)=0 |
---|
| 302 | vide(:,:)=0 |
---|
| 303 | ones(:,:)=0 |
---|
| 304 | |
---|
| 305 | |
---|
| 306 | !!------------------- |
---|
| 307 | !! Read dimensions |
---|
| 308 | !!------------------- |
---|
| 309 | |
---|
| 310 | print *,'>>> Read dimensions !' |
---|
| 311 | |
---|
| 312 | print *,'Time' |
---|
| 313 | SELECT CASE(ident) |
---|
| 314 | CASE('LMD') |
---|
| 315 | ierr = NF_INQ_VARID (nid, "Time",nvarid) |
---|
| 316 | CASE('OXF') |
---|
| 317 | ierr = NF_INQ_VARID (nid, "time",nvarid) |
---|
| 318 | END SELECT |
---|
| 319 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 320 | PRINT *, "Error: Readmeteo <Time> not found" |
---|
| 321 | stop |
---|
| 322 | ENDIF |
---|
| 323 | #ifdef NC_DOUBLE |
---|
| 324 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, time) |
---|
| 325 | #else |
---|
| 326 | ierr = NF_GET_VAR_REAL(nid, nvarid, time) |
---|
| 327 | #endif |
---|
| 328 | print *,time(1),' ... to ... ',time(timelen) |
---|
| 329 | |
---|
| 330 | print *,'Latitude' |
---|
| 331 | SELECT CASE(ident) |
---|
| 332 | CASE('LMD') |
---|
| 333 | ierr = NF_INQ_VARID (nid, "latitude",nvarid) |
---|
| 334 | CASE('OXF') |
---|
| 335 | ierr = NF_INQ_VARID (nid, "lat",nvarid) |
---|
| 336 | END SELECT |
---|
| 337 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 338 | PRINT *, "Error: Readmeteo <latitude> not found" |
---|
| 339 | stop |
---|
| 340 | ENDIF |
---|
| 341 | #ifdef NC_DOUBLE |
---|
| 342 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, lat) |
---|
| 343 | #else |
---|
| 344 | ierr = NF_GET_VAR_REAL(nid, nvarid, lat) |
---|
| 345 | #endif |
---|
| 346 | print *,lat(1),' ... to ... ',lat(latlen),' ... step: ',lat(latlen)-lat(latlen-1) |
---|
| 347 | |
---|
| 348 | print *,'Longitude' |
---|
| 349 | SELECT CASE(ident) |
---|
| 350 | CASE('LMD') |
---|
| 351 | ierr = NF_INQ_VARID (nid, "longitude",nvarid) |
---|
| 352 | CASE('OXF') |
---|
| 353 | ierr = NF_INQ_VARID (nid, "lon",nvarid) |
---|
| 354 | END SELECT |
---|
| 355 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 356 | PRINT *, "Error: Readmeteo <longitude> not found" |
---|
| 357 | stop |
---|
| 358 | ENDIF |
---|
| 359 | #ifdef NC_DOUBLE |
---|
| 360 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, lon) |
---|
| 361 | #else |
---|
| 362 | ierr = NF_GET_VAR_REAL(nid, nvarid, lon) |
---|
| 363 | #endif |
---|
| 364 | print *,lon(1),' ... to ... ',lon(lonlen),' ... step: ',lon(lonlen)-lon(lonlen-1) |
---|
| 365 | |
---|
| 366 | SELECT CASE(ident) |
---|
| 367 | CASE('LMD') |
---|
| 368 | print *, 'Hybrid coordinates' |
---|
| 369 | ierr = NF_INQ_VARID (nid, "ap", nvarid) |
---|
| 370 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 371 | PRINT *, "Error: Readmeteo <aps> not found" |
---|
| 372 | stop |
---|
| 373 | ENDIF |
---|
| 374 | #ifdef NC_DOUBLE |
---|
| 375 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, aps) |
---|
| 376 | #else |
---|
| 377 | ierr = NF_GET_VAR_REAL(nid, nvarid, aps) |
---|
| 378 | #endif |
---|
| 379 | ierr = NF_INQ_VARID (nid, "bp", nvarid) |
---|
| 380 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 381 | PRINT *, "Error: Readmeteo <bps> not found" |
---|
| 382 | stop |
---|
| 383 | ENDIF |
---|
| 384 | #ifdef NC_DOUBLE |
---|
| 385 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, bps) |
---|
| 386 | #else |
---|
| 387 | ierr = NF_GET_VAR_REAL(nid, nvarid, bps) |
---|
| 388 | #endif |
---|
| 389 | print *,aps(1),' ... to ... ',aps(altlen) |
---|
| 390 | print *,bps(1),' ... to ... ',bps(altlen) |
---|
| 391 | CASE('OXF') |
---|
| 392 | ierr = NF_INQ_VARID (nid, "sigma", nvarid) |
---|
| 393 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 394 | PRINT *, "Error: Readmeteo <sigma> not found" |
---|
| 395 | stop |
---|
| 396 | ENDIF |
---|
| 397 | #ifdef NC_DOUBLE |
---|
| 398 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, bps) |
---|
| 399 | #else |
---|
| 400 | ierr = NF_GET_VAR_REAL(nid, nvarid, bps) |
---|
| 401 | #endif |
---|
| 402 | print *,bps(1),' ... to ... ',bps(altlen) |
---|
| 403 | END SELECT |
---|
| 404 | |
---|
| 405 | |
---|
| 406 | !!------------------------------------------- |
---|
| 407 | !! Reading 2D and 3D meteorological fields |
---|
| 408 | !!------------------------------------------- |
---|
| 409 | |
---|
| 410 | IF (blank .EQV. .false.) THEN |
---|
| 411 | |
---|
| 412 | print *,'>>> Read 2D optional fields !' |
---|
| 413 | |
---|
| 414 | print *,'Emissivity' |
---|
| 415 | ierr = NF_INQ_VARID (nid,"emis",nvarid) |
---|
| 416 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 417 | PRINT *, '...warning: not found in diagfi !' |
---|
| 418 | PRINT *, '...will be filled with a prescribed value', emiss_prescribed |
---|
| 419 | emissfile(:,:,:)=emiss_prescribed |
---|
| 420 | ELSE |
---|
| 421 | #ifdef NC_DOUBLE |
---|
| 422 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, emissfile) |
---|
| 423 | #else |
---|
| 424 | ierr = NF_GET_VAR_REAL(nid, nvarid, emissfile) |
---|
| 425 | #endif |
---|
| 426 | ENDIF |
---|
| 427 | |
---|
| 428 | print *,'CO2 ice' |
---|
| 429 | ierr = NF_INQ_VARID (nid,"co2ice",nvarid) |
---|
| 430 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 431 | PRINT *, '...warning: not found in diagfi !' |
---|
| 432 | PRINT *, '...will be filled with a prescribed value', co2ice_prescribed |
---|
| 433 | co2icefile(:,:,:)=co2ice_prescribed |
---|
| 434 | ELSE |
---|
| 435 | #ifdef NC_DOUBLE |
---|
| 436 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, co2icefile) |
---|
| 437 | #else |
---|
| 438 | ierr = NF_GET_VAR_REAL(nid, nvarid, co2icefile) |
---|
| 439 | #endif |
---|
| 440 | ENDIF |
---|
| 441 | |
---|
| 442 | print *,'>>> Read 2D surface fields !' |
---|
| 443 | |
---|
| 444 | print *,'Surface Pressure' |
---|
| 445 | ierr = NF_INQ_VARID (nid,"ps",nvarid) |
---|
| 446 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 447 | PRINT *, "Error: Readmeteo <ps> not found" |
---|
| 448 | stop |
---|
| 449 | ENDIF |
---|
| 450 | #ifdef NC_DOUBLE |
---|
| 451 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, psfile) |
---|
| 452 | #else |
---|
| 453 | ierr = NF_GET_VAR_REAL(nid, nvarid, psfile) |
---|
| 454 | #endif |
---|
| 455 | |
---|
| 456 | print *,'Ground Temperature' |
---|
| 457 | ierr = NF_INQ_VARID (nid,"tsurf",nvarid) |
---|
| 458 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 459 | PRINT *, "Error: Readmeteo <tsurf> not found" |
---|
| 460 | stop |
---|
| 461 | ENDIF |
---|
| 462 | #ifdef NC_DOUBLE |
---|
| 463 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tsfile) |
---|
| 464 | #else |
---|
| 465 | ierr = NF_GET_VAR_REAL(nid, nvarid, tsfile) |
---|
| 466 | #endif |
---|
| 467 | |
---|
| 468 | |
---|
| 469 | !!!"atmospheric" surface temperature is taken |
---|
| 470 | !!!from original diagfi.nc first level |
---|
| 471 | !!!... level is ~3-5 meters |
---|
| 472 | !print *,'Near-Surface Temperature' |
---|
| 473 | ! ierr = NF_INQ_VARID (nid,"temp",nvarid) |
---|
| 474 | ! IF (ierr .NE. NF_NOERR) THEN |
---|
| 475 | ! ierr = NF_INQ_VARID (nid,"t",nvarid) |
---|
| 476 | ! IF (ierr .NE. NF_NOERR) THEN |
---|
| 477 | ! PRINT *, "Error: Readmeteo <temp> not found" |
---|
| 478 | ! stop |
---|
| 479 | ! ENDIF |
---|
| 480 | ! ENDIF |
---|
| 481 | !#ifdef NC_DOUBLE |
---|
| 482 | ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfileorig) |
---|
| 483 | !#else |
---|
| 484 | ! ierr = NF_GET_VAR_REAL(nid, nvarid, tfileorig) |
---|
| 485 | !#endif |
---|
| 486 | ! tnsfile=tfileorig(:,:,1,:) |
---|
| 487 | |
---|
| 488 | !!!"atmospheric" surface u is taken |
---|
| 489 | !!!from original diagfi.nc first level |
---|
| 490 | !!!... level is ~3-5 meters |
---|
| 491 | !print *,'Near-Surface Zonal Wind' |
---|
| 492 | ! ierr = NF_INQ_VARID (nid,"u",nvarid) |
---|
| 493 | ! IF (ierr .NE. NF_NOERR) THEN |
---|
| 494 | ! PRINT *, "Error: Readmeteo <u> not found" |
---|
| 495 | ! stop |
---|
| 496 | ! ENDIF |
---|
| 497 | !#ifdef NC_DOUBLE |
---|
| 498 | ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufileorig) |
---|
| 499 | !#else |
---|
| 500 | ! ierr = NF_GET_VAR_REAL(nid, nvarid, ufileorig) |
---|
| 501 | !#endif |
---|
| 502 | ! unsfile=ufileorig(:,:,1,:) |
---|
| 503 | |
---|
| 504 | !!!"atmospheric" surface v is taken |
---|
| 505 | !!!from original diagfi.nc first level |
---|
| 506 | !!!... level is ~3-5 meters |
---|
| 507 | !print *,'Near-Surface Meridional Wind' |
---|
| 508 | ! ierr = NF_INQ_VARID (nid,"v",nvarid) |
---|
| 509 | ! IF (ierr .NE. NF_NOERR) THEN |
---|
| 510 | ! PRINT *, "Error: Readmeteo <v> not found" |
---|
| 511 | ! stop |
---|
| 512 | ! ENDIF |
---|
| 513 | !#ifdef NC_DOUBLE |
---|
| 514 | ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfileorig) |
---|
| 515 | !#else |
---|
| 516 | ! ierr = NF_GET_VAR_REAL(nid, nvarid, vfileorig) |
---|
| 517 | !#endif |
---|
| 518 | ! vnsfile=vfileorig(:,:,1,:) |
---|
| 519 | |
---|
| 520 | SELECT CASE(ident) |
---|
| 521 | CASE('LMD') |
---|
| 522 | print *,'Geopotential height at the ground' |
---|
| 523 | ierr = NF_INQ_VARID (nid,"phisinit",nvarid) |
---|
| 524 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 525 | PRINT *, "Error: Readmeteo <phisinit> not found" |
---|
| 526 | stop |
---|
| 527 | ENDIF |
---|
| 528 | #ifdef NC_DOUBLE |
---|
| 529 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ghtsfile) |
---|
| 530 | #else |
---|
| 531 | ierr = NF_GET_VAR_REAL(nid, nvarid, ghtsfile) |
---|
| 532 | #endif |
---|
| 533 | !**** from geopotential to geopotential height |
---|
| 534 | ghtsfile=ghtsfile/grav |
---|
| 535 | !**** |
---|
| 536 | CASE('OXF') |
---|
| 537 | ! |
---|
| 538 | ! geopotential height ~ altimetry |
---|
| 539 | ! |
---|
| 540 | print *,'Geopotential height at the ground from file mountain_new.nc' |
---|
| 541 | ierr=NF_OPEN("mountain_new.nc",NF_NOWRITE,nid3) |
---|
| 542 | if (ierr.ne.NF_NOERR) then |
---|
| 543 | write(*,*) "Error: Could not open that file either" |
---|
| 544 | stop "Might as well stop here" |
---|
| 545 | endif |
---|
| 546 | ierr=NF_INQ_VARID(nid3,"orography",nvarid) |
---|
| 547 | ierr=NF_GET_VAR_REAL(nid3,nvarid,ghtsfile) |
---|
| 548 | if (ierr.ne.NF_NOERR) then |
---|
| 549 | stop "Error: Failed reading phisinit" |
---|
| 550 | endif |
---|
| 551 | ierr=NF_CLOSE(nid3) |
---|
| 552 | END SELECT |
---|
| 553 | |
---|
| 554 | |
---|
| 555 | print *,'>>> Read 3D meteorological fields ! - This may take some time ...' |
---|
| 556 | |
---|
| 557 | print *,'Temperature' |
---|
| 558 | ierr = NF_INQ_VARID (nid,"temp",nvarid) |
---|
| 559 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 560 | ierr = NF_INQ_VARID (nid,"t",nvarid) |
---|
| 561 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 562 | PRINT *, "Error: Readmeteo <t> not found" |
---|
| 563 | stop |
---|
| 564 | ENDIF |
---|
| 565 | ENDIF |
---|
| 566 | #ifdef NC_DOUBLE |
---|
| 567 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfile) |
---|
| 568 | #else |
---|
| 569 | ierr = NF_GET_VAR_REAL(nid, nvarid, tfile) |
---|
| 570 | #endif |
---|
| 571 | tnsfile=tfile(:,:,1,:) |
---|
| 572 | |
---|
| 573 | print *,'Zonal wind' |
---|
| 574 | ierr = NF_INQ_VARID (nid,"u",nvarid) |
---|
| 575 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 576 | PRINT *, "Error: Readmeteo <u> not found" |
---|
| 577 | stop |
---|
| 578 | ENDIF |
---|
| 579 | #ifdef NC_DOUBLE |
---|
| 580 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufile) |
---|
| 581 | #else |
---|
| 582 | ierr = NF_GET_VAR_REAL(nid, nvarid, ufile) |
---|
| 583 | #endif |
---|
| 584 | unsfile=ufile(:,:,1,:) |
---|
| 585 | |
---|
| 586 | print *,'Meridional wind' |
---|
| 587 | ierr = NF_INQ_VARID (nid,"v",nvarid) |
---|
| 588 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 589 | PRINT *, "Error: Readmeteo <v> not found" |
---|
| 590 | stop |
---|
| 591 | ENDIF |
---|
| 592 | #ifdef NC_DOUBLE |
---|
| 593 | ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfile) |
---|
| 594 | #else |
---|
| 595 | ierr = NF_GET_VAR_REAL(nid, nvarid, vfile) |
---|
| 596 | #endif |
---|
| 597 | vnsfile=ufile(:,:,1,:) |
---|
| 598 | |
---|
| 599 | |
---|
| 600 | !!------------------------ |
---|
| 601 | !! special water stuff |
---|
| 602 | !!------------------------ |
---|
| 603 | print *,'Water vapor' |
---|
| 604 | ierr=NF_INQ_VARID(nid,"h2o_vap",nvarid) |
---|
| 605 | if (ierr.ne.NF_NOERR) then |
---|
| 606 | write(*,*) "...No q02 - Water vapor set to 0" |
---|
| 607 | waterfile(:,:,:,:)=0. |
---|
| 608 | else |
---|
| 609 | ierr=NF_GET_VAR_REAL(nid,nvarid,waterfile) |
---|
| 610 | endif |
---|
| 611 | |
---|
| 612 | print *,'Water ice' |
---|
| 613 | ierr=NF_INQ_VARID(nid,"h2o_ice",nvarid) |
---|
| 614 | if (ierr.ne.NF_NOERR) then |
---|
| 615 | write(*,*) "...No q01 - Water ice set to 0" |
---|
| 616 | watericefile(:,:,:,:)=0. |
---|
| 617 | else |
---|
| 618 | ierr=NF_GET_VAR_REAL(nid,nvarid,watericefile) |
---|
| 619 | endif |
---|
| 620 | ! print *,'Surface Water vapor' |
---|
| 621 | ! ierr=NF_INQ_VARID(nid,"qsurf02",nvarid) |
---|
| 622 | ! if (ierr.ne.NF_NOERR) then |
---|
| 623 | ! write(*,*) "...No qsurf02 - surface Water vapor set to 0" |
---|
| 624 | ! swaterfile(:,:,:)=0. |
---|
| 625 | ! endif |
---|
| 626 | ! ierr=NF_GET_VAR_REAL(nid,nvarid,swaterfile) |
---|
| 627 | |
---|
| 628 | print *,'Surface Water ice' |
---|
| 629 | !!!!!! ATTENTION ATTENTION |
---|
| 630 | !!!!!! water ice a la surface est qsurf(ig,nqmx) |
---|
| 631 | ierr=NF_INQ_VARID(nid,"qsurf02",nvarid) |
---|
| 632 | if (ierr.ne.NF_NOERR) then |
---|
| 633 | write(*,*) "...No qsurf02 - surface Water ice set to 0" |
---|
| 634 | swatericefile(:,:,:)=0. |
---|
| 635 | else |
---|
| 636 | ierr=NF_GET_VAR_REAL(nid,nvarid,swatericefile) |
---|
| 637 | endif |
---|
| 638 | !!------------------------ |
---|
| 639 | !! special water stuff |
---|
| 640 | !!------------------------ |
---|
| 641 | |
---|
| 642 | print *,'CO2 mass mixing ratio' |
---|
| 643 | ierr=NF_INQ_VARID(nid,"co2",nvarid) |
---|
| 644 | if (ierr.ne.NF_NOERR) then |
---|
| 645 | write(*,*) "...No co2 - co2 mixing ratio set to 0.95" |
---|
| 646 | co2file(:,:,:,:)=0.95 |
---|
| 647 | co2file(:,:,:,:)=0.0 |
---|
| 648 | else |
---|
| 649 | ierr=NF_GET_VAR_REAL(nid,nvarid,co2file) |
---|
| 650 | endif |
---|
| 651 | |
---|
| 652 | !!------------------------ |
---|
| 653 | !! special dust stuff |
---|
| 654 | !!------------------------ |
---|
| 655 | print *,'Dust mass' |
---|
| 656 | ierr=NF_INQ_VARID(nid,"dustq",nvarid) |
---|
| 657 | if (ierr.ne.NF_NOERR) then |
---|
| 658 | write(*,*) "...No dustq - Dust mass set to 0" |
---|
| 659 | dustfile(:,:,:,:)=0. |
---|
| 660 | else |
---|
| 661 | ierr=NF_GET_VAR_REAL(nid,nvarid,dustfile) |
---|
| 662 | endif |
---|
| 663 | |
---|
| 664 | print *,'Dust number' |
---|
| 665 | ierr=NF_INQ_VARID(nid,"dustN",nvarid) |
---|
| 666 | if (ierr.ne.NF_NOERR) then |
---|
| 667 | write(*,*) "...No dustN - Dust number set to 0" |
---|
| 668 | dustnfile(:,:,:,:)=0. |
---|
| 669 | else |
---|
| 670 | ierr=NF_GET_VAR_REAL(nid,nvarid,dustnfile) |
---|
| 671 | endif |
---|
| 672 | |
---|
| 673 | print *,'CCN mass' |
---|
| 674 | ierr=NF_INQ_VARID(nid,"ccn",nvarid) |
---|
| 675 | if (ierr.ne.NF_NOERR) then |
---|
| 676 | write(*,*) "...No ccn - CCN mass set to 0" |
---|
| 677 | ccnfile(:,:,:,:)=0. |
---|
| 678 | else |
---|
| 679 | ierr=NF_GET_VAR_REAL(nid,nvarid,ccnfile) |
---|
| 680 | endif |
---|
| 681 | |
---|
| 682 | print *,'CCN number' |
---|
| 683 | ierr=NF_INQ_VARID(nid,"ccnN",nvarid) |
---|
| 684 | if (ierr.ne.NF_NOERR) then |
---|
| 685 | write(*,*) "...No ccnN - CCN number set to 0" |
---|
| 686 | ccnnfile(:,:,:,:)=0. |
---|
| 687 | else |
---|
| 688 | ierr=NF_GET_VAR_REAL(nid,nvarid,ccnnfile) |
---|
| 689 | endif |
---|
| 690 | !!------------------------ |
---|
| 691 | !! special dust stuff |
---|
| 692 | !!------------------------ |
---|
| 693 | |
---|
| 694 | !SELECT CASE(ident) |
---|
| 695 | !CASE('LMD') |
---|
| 696 | |
---|
| 697 | print *,'Soil temperatures' |
---|
| 698 | ierr=NF_INQ_VARID(nid,"tsoil",nvarid) |
---|
| 699 | if (ierr.ne.NF_NOERR) then |
---|
| 700 | write(*,*) "...No tsoil - Soil temperatures set isothermal with surface temperature" |
---|
| 701 | DO l=1,altlen |
---|
| 702 | tsoilfile(:,:,l,:)=tsfile(:,:,:) |
---|
| 703 | ENDDO |
---|
| 704 | else |
---|
| 705 | ierr=NF_GET_VAR_REAL(nid,nvarid,tsoilfile) |
---|
| 706 | endif |
---|
| 707 | |
---|
| 708 | !!!!!!!! |
---|
| 709 | !!!!!!!! new physics (but still compatible with old physics) |
---|
| 710 | print *,'Soil depths' |
---|
| 711 | ierr=NF_INQ_VARID(nid,"soildepth",nvarid) |
---|
| 712 | if (ierr.ne.NF_NOERR) then |
---|
| 713 | write(*,*) "...No soildepth - Set to -999" !!! see soil_settings in LMD physics |
---|
| 714 | DO l=1,altlen |
---|
| 715 | vertdsoil(l)=-999. |
---|
| 716 | ENDDO |
---|
| 717 | else |
---|
| 718 | ierr=NF_GET_VAR_REAL(nid,nvarid,vertdsoil) |
---|
| 719 | endif |
---|
| 720 | print *, 'wait a minute' !! AS: I know this could be better |
---|
| 721 | DO m=1,lonlen |
---|
| 722 | DO n=1,latlen |
---|
| 723 | DO p=1,timelen |
---|
| 724 | dsoilfile(m,n,:,p) = vertdsoil(:) |
---|
| 725 | ENDDO |
---|
| 726 | ENDDO |
---|
| 727 | ENDDO |
---|
| 728 | DEALLOCATE(vertdsoil) |
---|
| 729 | |
---|
| 730 | print *,'Soil thermal inertia' |
---|
| 731 | ierr=NF_INQ_VARID(nid,"inertiedat",nvarid) |
---|
| 732 | if (ierr.ne.NF_NOERR) then |
---|
| 733 | write(*,*) "...No soil therm. inert. - Set to -999" |
---|
| 734 | DO l=1,altlen |
---|
| 735 | isoilfile(:,:,l,:)=-999. |
---|
| 736 | ENDDO |
---|
| 737 | else |
---|
| 738 | ierr=NF_GET_VAR_REAL(nid,nvarid,isoilfile) |
---|
| 739 | endif |
---|
| 740 | !!!!!!!! |
---|
| 741 | !!!!!!!! new physics |
---|
| 742 | |
---|
| 743 | |
---|
| 744 | !!!!!!!!!!!!!!!!!!!!!!!!NEW PHYSICS + PHOTOCHEM |
---|
| 745 | !!!!!!!!!!!!!!!!!!!!!!!!NEW PHYSICS + PHOTOCHEM |
---|
| 746 | #ifdef PHOTOCHEM |
---|
| 747 | print *,'photochem' |
---|
| 748 | DO i=1,nchemtrac |
---|
| 749 | print *,wtnom(i) |
---|
| 750 | ierr=NF_INQ_VARID(nid,wtnom(i),nvarid) |
---|
| 751 | if (ierr.ne.NF_NOERR) then |
---|
| 752 | write(*,*) "...No ",wtnom(i), " - set to 0" |
---|
| 753 | chemtrac(:,:,:,:,i)=0. |
---|
| 754 | else |
---|
| 755 | ierr=NF_GET_VAR_REAL(nid,nvarid,chemtrac(:,:,:,:,i)) |
---|
| 756 | endif |
---|
| 757 | ENDDO |
---|
| 758 | #endif |
---|
| 759 | !!!!!!!!!!!!!!!!!!!!!!!!NEW PHYSICS + PHOTOCHEM |
---|
| 760 | !!!!!!!!!!!!!!!!!!!!!!!!NEW PHYSICS + PHOTOCHEM |
---|
| 761 | |
---|
| 762 | |
---|
| 763 | |
---|
| 764 | !END SELECT |
---|
| 765 | |
---|
| 766 | ierr=NF_CLOSE(nid) |
---|
| 767 | |
---|
| 768 | !!!!lott stuff |
---|
| 769 | !print *,'get lott' |
---|
| 770 | !ierr=NF_OPEN("init_lott.nc",NF_NOWRITE,nid3) |
---|
| 771 | !ierr=NF_INQ_VARID(nid3,"ZMEA",nvarid) |
---|
| 772 | !ierr=NF_GET_VAR_REAL(nid3,nvarid,interm) |
---|
| 773 | !gwparam(:,:,1)=interm(:,:) |
---|
| 774 | !ierr=NF_INQ_VARID(nid3,"ZSTD",nvarid) |
---|
| 775 | !ierr=NF_GET_VAR_REAL(nid3,nvarid,interm) |
---|
| 776 | !gwparam(:,:,2)=interm(:,:) |
---|
| 777 | !ierr=NF_INQ_VARID(nid3,"ZSIG",nvarid) |
---|
| 778 | !ierr=NF_GET_VAR_REAL(nid3,nvarid,interm) |
---|
| 779 | !gwparam(:,:,3)=interm(:,:) |
---|
| 780 | !ierr=NF_INQ_VARID(nid3,"ZGAM",nvarid) |
---|
| 781 | !ierr=NF_GET_VAR_REAL(nid3,nvarid,interm) |
---|
| 782 | !gwparam(:,:,4)=interm(:,:) |
---|
| 783 | !ierr=NF_INQ_VARID(nid3,"ZTHE",nvarid) |
---|
| 784 | !ierr=NF_GET_VAR_REAL(nid3,nvarid,interm) |
---|
| 785 | !gwparam(:,:,5)=interm(:,:) |
---|
| 786 | !ierr=NF_CLOSE(nid3) |
---|
| 787 | |
---|
| 788 | ENDIF |
---|
| 789 | |
---|
| 790 | !!----------------------------- |
---|
| 791 | !! Loop on the written files |
---|
| 792 | !! >>> what follows is pretty repetitive ... |
---|
| 793 | !! gotta do something (one more loop?) |
---|
| 794 | !!----------------------------- |
---|
| 795 | |
---|
| 796 | !!! Equivalent eta levels for WRF interpolation in initialize_real |
---|
| 797 | !print *,'Computing equivalent eta levels' |
---|
| 798 | ! |
---|
| 799 | ! !ptop will be passed through RH(surface) |
---|
| 800 | ! ptop=MINVAL(aps(altlen)+bps(altlen)*psfile(:,:,:)) |
---|
| 801 | ! print *, 'ptop', ptop |
---|
| 802 | ! |
---|
| 803 | !print *, 'sample: equivalent eta levels at i=1,j=1' |
---|
| 804 | !DO k = 1,altlen |
---|
| 805 | ! levels(k)=-k |
---|
| 806 | ! eta_gcm(:,:,k,:)=(aps(k)+bps(k)*psfile(:,:,:)-ptop)/(psfile(:,:,:)-ptop) |
---|
| 807 | ! print *, eta_gcm(1,1,k,1) |
---|
| 808 | !END DO |
---|
| 809 | |
---|
| 810 | !!---better to pass pressure values |
---|
| 811 | !!---the eta treatment is done in module_initialize_real |
---|
| 812 | DO k = 1,altlen |
---|
| 813 | levels(k)=-k |
---|
| 814 | !!dummy decreasing levels |
---|
| 815 | END DO |
---|
| 816 | |
---|
| 817 | |
---|
| 818 | |
---|
| 819 | |
---|
| 820 | !! Dummy surface level is XLVL=200100. |
---|
| 821 | |
---|
| 822 | |
---|
| 823 | DO l=1,FILES |
---|
| 824 | |
---|
| 825 | |
---|
| 826 | !!--------------------------------------------- |
---|
| 827 | !! Write file in intermediate format for WPS |
---|
| 828 | !! 1. Surface data |
---|
| 829 | !!--------------------------------------------- |
---|
| 830 | !! |
---|
| 831 | !! a mettre pour tous sinon |
---|
| 832 | !! WRF_DEBUG: Warning DIM 4 , NAME num_metgrid_levels REDIFINED by |
---|
| 833 | !! var DUSTN 26 25 in wrf_io.F90 line 2349 |
---|
| 834 | !! |
---|
| 835 | |
---|
| 836 | ! |
---|
| 837 | ! These variables remain the same in the "loop" |
---|
| 838 | ! |
---|
| 839 | HDATE=date_out(l) |
---|
| 840 | IFV=4 |
---|
| 841 | XFCST=0. |
---|
| 842 | SOURCE=ident |
---|
| 843 | NX=lonlen |
---|
| 844 | NY=latlen |
---|
| 845 | ALLOCATE(SLAB(NX,NY)) |
---|
| 846 | IPROJ=0 |
---|
| 847 | STARTLOC='SWCORNER' |
---|
| 848 | STARTLAT=lat(1) |
---|
| 849 | STARTLON=lon(1) |
---|
| 850 | DELTALAT=lat(latlen)-lat(latlen-1) |
---|
| 851 | DELTALON=lon(lonlen)-lon(lonlen-1) |
---|
| 852 | ! |
---|
| 853 | ! Open the data destination file |
---|
| 854 | ! |
---|
| 855 | output="./WPSFEED/"//ident//":"//date_out2(l) |
---|
| 856 | open(UNIT=1, & |
---|
| 857 | FILE=output, & |
---|
| 858 | STATUS='REPLACE', & |
---|
| 859 | FORM='UNFORMATTED', & |
---|
| 860 | ACCESS='SEQUENTIAL') |
---|
| 861 | |
---|
| 862 | !------------------------! |
---|
| 863 | ! >>> Write a variable ! |
---|
| 864 | ! ... Copy&Paste part ! |
---|
| 865 | !------------------------! |
---|
| 866 | FIELD='T' |
---|
| 867 | UNITS='K' |
---|
| 868 | DESC='Atmospheric temperature' |
---|
| 869 | XLVL=200100. |
---|
| 870 | SLAB=tnsfile(:,:,time_out(l)) |
---|
| 871 | ! And now put everything in the destination file |
---|
| 872 | ! ... Header |
---|
| 873 | write(1) IFV |
---|
| 874 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 875 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 876 | ! ... Data |
---|
| 877 | write(1) SLAB |
---|
| 878 | !print *,'The field '//DESC//' was written to '//output |
---|
| 879 | |
---|
| 880 | !------------------------! |
---|
| 881 | ! >>> Write a variable ! |
---|
| 882 | ! ... Copy&Paste part ! |
---|
| 883 | !------------------------! |
---|
| 884 | FIELD='U' |
---|
| 885 | UNITS='m s{-1}' |
---|
| 886 | DESC='Zonal wind' |
---|
| 887 | XLVL=200100. |
---|
| 888 | SLAB=unsfile(:,:,time_out(l)) |
---|
| 889 | ! And now put everything in the destination file |
---|
| 890 | ! ... Header |
---|
| 891 | write(1) IFV |
---|
| 892 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 893 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 894 | ! ... Data |
---|
| 895 | write(1) SLAB |
---|
| 896 | !print *,'The field '//DESC//' was written to '//output |
---|
| 897 | |
---|
| 898 | !------------------------! |
---|
| 899 | ! >>> Write a variable ! |
---|
| 900 | ! ... Copy&Paste part ! |
---|
| 901 | !------------------------! |
---|
| 902 | FIELD='V' |
---|
| 903 | UNITS='m s{-1}' |
---|
| 904 | DESC='Meridional wind' |
---|
| 905 | XLVL=200100. |
---|
| 906 | SLAB=vnsfile(:,:,time_out(l)) |
---|
| 907 | ! And now put everything in the destination file |
---|
| 908 | ! ... Header |
---|
| 909 | write(1) IFV |
---|
| 910 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 911 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 912 | ! ... Data |
---|
| 913 | write(1) SLAB |
---|
| 914 | !print *,'The field '//DESC//' was written to '//output |
---|
| 915 | |
---|
| 916 | !------------------------! |
---|
| 917 | ! >>> Write a variable ! |
---|
| 918 | ! ... Copy&Paste part ! |
---|
| 919 | !------------------------! |
---|
| 920 | FIELD='RH' |
---|
| 921 | UNITS='' |
---|
| 922 | DESC='Customized 2D static field' |
---|
| 923 | XLVL=200100. |
---|
| 924 | SLAB=vide(:,:) |
---|
| 925 | ! And now put everything in the destination file |
---|
| 926 | ! ... Header |
---|
| 927 | write(1) IFV |
---|
| 928 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 929 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 930 | ! ... Data |
---|
| 931 | write(1) SLAB |
---|
| 932 | !print *,'The field '//DESC//' was written to '//output |
---|
| 933 | |
---|
| 934 | !------------------------! |
---|
| 935 | ! >>> Write a variable ! |
---|
| 936 | ! ... Copy&Paste part ! |
---|
| 937 | !------------------------! |
---|
| 938 | FIELD='SOILHGT' |
---|
| 939 | UNITS='m' |
---|
| 940 | DESC='Terrain field of source analysis' !Ground geopotential height |
---|
| 941 | XLVL=200100. |
---|
| 942 | SLAB=ghtsfile(:,:) |
---|
| 943 | ! And now put everything in the destination file |
---|
| 944 | ! ... Header |
---|
| 945 | write(1) IFV |
---|
| 946 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 947 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 948 | ! ... Data |
---|
| 949 | write(1) SLAB |
---|
| 950 | !print *,'The field '//DESC//' was written to '//output |
---|
| 951 | |
---|
| 952 | !------------------------! |
---|
| 953 | ! >>> Write a variable ! |
---|
| 954 | ! ... Copy&Paste part ! |
---|
| 955 | !------------------------! |
---|
| 956 | FIELD='PSFC' |
---|
| 957 | UNITS='Pa' |
---|
| 958 | DESC='Surface Pressure' |
---|
| 959 | XLVL=200100. |
---|
| 960 | SLAB=psfile(:,:,time_out(l)) |
---|
| 961 | ! And now put everything in the destination file |
---|
| 962 | ! ... Header |
---|
| 963 | write(1) IFV |
---|
| 964 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 965 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 966 | ! ... Data |
---|
| 967 | write(1) SLAB |
---|
| 968 | !print *,'The field '//DESC//' was written to '//output |
---|
| 969 | |
---|
| 970 | !------------------------! |
---|
| 971 | ! >>> Write a variable ! |
---|
| 972 | ! ... Copy&Paste part ! |
---|
| 973 | !------------------------! |
---|
| 974 | FIELD='ST000010' |
---|
| 975 | UNITS='' |
---|
| 976 | DESC='Emissivity' |
---|
| 977 | XLVL=200100. |
---|
| 978 | SLAB=emissfile(:,:,time_out(l)) |
---|
| 979 | ! And now put everything in the destination file |
---|
| 980 | ! ... Header |
---|
| 981 | write(1) IFV |
---|
| 982 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 983 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 984 | ! ... Data |
---|
| 985 | write(1) SLAB |
---|
| 986 | !print *,'The field '//DESC//' was written to '//output |
---|
| 987 | |
---|
| 988 | !------------------------! |
---|
| 989 | ! >>> Write a variable ! |
---|
| 990 | ! ... Copy&Paste part ! |
---|
| 991 | !------------------------! |
---|
| 992 | FIELD='ST010040' |
---|
| 993 | UNITS='' |
---|
| 994 | DESC='CO2 ice' |
---|
| 995 | XLVL=200100. |
---|
| 996 | SLAB=co2icefile(:,:,time_out(l)) |
---|
| 997 | ! And now put everything in the destination file |
---|
| 998 | ! ... Header |
---|
| 999 | write(1) IFV |
---|
| 1000 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1001 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1002 | ! ... Data |
---|
| 1003 | write(1) SLAB |
---|
| 1004 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1005 | |
---|
| 1006 | !------------------------! |
---|
| 1007 | ! >>> Write a variable ! |
---|
| 1008 | ! ... Copy&Paste part ! |
---|
| 1009 | !------------------------! |
---|
| 1010 | FIELD='ST040100' |
---|
| 1011 | UNITS='' |
---|
| 1012 | DESC='ZMEA' |
---|
| 1013 | XLVL=200100. |
---|
| 1014 | SLAB=gwparam(:,:,1) |
---|
| 1015 | ! And now put everything in the destination file |
---|
| 1016 | ! ... Header |
---|
| 1017 | write(1) IFV |
---|
| 1018 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1019 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1020 | ! ... Data |
---|
| 1021 | write(1) SLAB |
---|
| 1022 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1023 | |
---|
| 1024 | !------------------------! |
---|
| 1025 | ! >>> Write a variable ! |
---|
| 1026 | ! ... Copy&Paste part ! |
---|
| 1027 | !------------------------! |
---|
| 1028 | FIELD='ST100200' |
---|
| 1029 | UNITS='' |
---|
| 1030 | DESC='ZSTD' |
---|
| 1031 | XLVL=200100. |
---|
| 1032 | SLAB=gwparam(:,:,2) |
---|
| 1033 | ! And now put everything in the destination file |
---|
| 1034 | ! ... Header |
---|
| 1035 | write(1) IFV |
---|
| 1036 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1037 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1038 | ! ... Data |
---|
| 1039 | write(1) SLAB |
---|
| 1040 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1041 | |
---|
| 1042 | !------------------------! |
---|
| 1043 | ! >>> Write a variable ! |
---|
| 1044 | ! ... Copy&Paste part ! |
---|
| 1045 | !------------------------! |
---|
| 1046 | FIELD='LANDSEA' |
---|
| 1047 | UNITS='0/1 Flag' |
---|
| 1048 | DESC='Land/Sea flag' |
---|
| 1049 | XLVL=200100. |
---|
| 1050 | SLAB=ones(:,:) |
---|
| 1051 | ! And now put everything in the destination file |
---|
| 1052 | ! ... Header |
---|
| 1053 | write(1) IFV |
---|
| 1054 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1055 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1056 | ! ... Data |
---|
| 1057 | write(1) SLAB |
---|
| 1058 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1059 | |
---|
| 1060 | !------------------------! |
---|
| 1061 | ! >>> Write a variable ! |
---|
| 1062 | ! ... Copy&Paste part ! |
---|
| 1063 | !------------------------! |
---|
| 1064 | FIELD='SKINTEMP' |
---|
| 1065 | UNITS='K' |
---|
| 1066 | DESC='Ground temperature' |
---|
| 1067 | XLVL=200100. |
---|
| 1068 | SLAB=tsfile(:,:,time_out(l)) |
---|
| 1069 | ! And now put everything in the destination file |
---|
| 1070 | ! ... Header |
---|
| 1071 | write(1) IFV |
---|
| 1072 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1073 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1074 | ! ... Data |
---|
| 1075 | write(1) SLAB |
---|
| 1076 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1077 | |
---|
| 1078 | !------------------------! |
---|
| 1079 | ! >>> Write a variable ! |
---|
| 1080 | ! ... Copy&Paste part ! |
---|
| 1081 | !------------------------! |
---|
| 1082 | FIELD='SM000010' |
---|
| 1083 | UNITS='' |
---|
| 1084 | DESC='ZSIG' |
---|
| 1085 | XLVL=200100. |
---|
| 1086 | SLAB=gwparam(:,:,3) |
---|
| 1087 | ! And now put everything in the destination file |
---|
| 1088 | ! ... Header |
---|
| 1089 | write(1) IFV |
---|
| 1090 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1091 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1092 | ! ... Data |
---|
| 1093 | write(1) SLAB |
---|
| 1094 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1095 | |
---|
| 1096 | !------------------------! |
---|
| 1097 | ! >>> Write a variable ! |
---|
| 1098 | ! ... Copy&Paste part ! |
---|
| 1099 | !------------------------! |
---|
| 1100 | FIELD='SM010040' |
---|
| 1101 | UNITS='' |
---|
| 1102 | DESC='ZGAM' |
---|
| 1103 | XLVL=200100. |
---|
| 1104 | SLAB=gwparam(:,:,4) |
---|
| 1105 | ! And now put everything in the destination file |
---|
| 1106 | ! ... Header |
---|
| 1107 | write(1) IFV |
---|
| 1108 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1109 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1110 | ! ... Data |
---|
| 1111 | write(1) SLAB |
---|
| 1112 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1113 | |
---|
| 1114 | !------------------------! |
---|
| 1115 | ! >>> Write a variable ! |
---|
| 1116 | ! ... Copy&Paste part ! |
---|
| 1117 | !------------------------! |
---|
| 1118 | FIELD='SM040100' |
---|
| 1119 | UNITS='' |
---|
| 1120 | DESC='ZTHE' |
---|
| 1121 | XLVL=200100. |
---|
| 1122 | SLAB=gwparam(:,:,5) |
---|
| 1123 | ! And now put everything in the destination file |
---|
| 1124 | ! ... Header |
---|
| 1125 | write(1) IFV |
---|
| 1126 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1127 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1128 | ! ... Data |
---|
| 1129 | write(1) SLAB |
---|
| 1130 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1131 | |
---|
| 1132 | !------------------------! |
---|
| 1133 | ! >>> Write a variable ! |
---|
| 1134 | ! ... Copy&Paste part ! |
---|
| 1135 | !------------------------! |
---|
| 1136 | FIELD='SM100200' |
---|
| 1137 | UNITS='kg/m2' |
---|
| 1138 | DESC='Surf water ice' |
---|
| 1139 | XLVL=200100. |
---|
| 1140 | SLAB=swatericefile(:,:,time_out(l)) |
---|
| 1141 | ! And now put everything in the destination file |
---|
| 1142 | ! ... Header |
---|
| 1143 | write(1) IFV |
---|
| 1144 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1145 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1146 | ! ... Data |
---|
| 1147 | write(1) SLAB |
---|
| 1148 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1149 | |
---|
| 1150 | |
---|
| 1151 | !------------------------! |
---|
| 1152 | ! >>> Write a variable ! |
---|
| 1153 | ! ... Copy&Paste part ! |
---|
| 1154 | !------------------------! |
---|
| 1155 | FIELD='HV' |
---|
| 1156 | UNITS='kg/kg' |
---|
| 1157 | DESC='Water vapor' |
---|
| 1158 | XLVL=200100. |
---|
| 1159 | SLAB=waterfile(:,:,1,time_out(l)) |
---|
| 1160 | ! And now put everything in the destination file |
---|
| 1161 | ! ... Header |
---|
| 1162 | write(1) IFV |
---|
| 1163 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1164 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1165 | ! ... Data |
---|
| 1166 | write(1) SLAB |
---|
| 1167 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1168 | |
---|
| 1169 | !------------------------! |
---|
| 1170 | ! >>> Write a variable ! |
---|
| 1171 | ! ... Copy&Paste part ! |
---|
| 1172 | !------------------------! |
---|
| 1173 | FIELD='HI' |
---|
| 1174 | UNITS='kg/kg' |
---|
| 1175 | DESC='Water ice' |
---|
| 1176 | XLVL=200100. |
---|
| 1177 | SLAB=watericefile(:,:,1,time_out(l)) |
---|
| 1178 | ! And now put everything in the destination file |
---|
| 1179 | ! ... Header |
---|
| 1180 | write(1) IFV |
---|
| 1181 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1182 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1183 | ! ... Data |
---|
| 1184 | write(1) SLAB |
---|
| 1185 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1186 | |
---|
| 1187 | !------------------------! |
---|
| 1188 | ! >>> Write a variable ! |
---|
| 1189 | ! ... Copy&Paste part ! |
---|
| 1190 | !------------------------! |
---|
| 1191 | FIELD='TSOIL' |
---|
| 1192 | UNITS='K' |
---|
| 1193 | DESC='Soil temperature' |
---|
| 1194 | XLVL=200100. |
---|
| 1195 | SLAB=tsoilfile(:,:,1,time_out(l)) |
---|
| 1196 | ! And now put everything in the destination file |
---|
| 1197 | ! ... Header |
---|
| 1198 | write(1) IFV |
---|
| 1199 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1200 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1201 | ! ... Data |
---|
| 1202 | write(1) SLAB |
---|
| 1203 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1204 | |
---|
| 1205 | !------------------------! |
---|
| 1206 | ! >>> Write a variable ! |
---|
| 1207 | ! ... Copy&Paste part ! |
---|
| 1208 | !------------------------! |
---|
| 1209 | FIELD='DSOIL' |
---|
| 1210 | UNITS='m' |
---|
| 1211 | DESC='Soil depths' |
---|
| 1212 | XLVL=200100. |
---|
| 1213 | SLAB=dsoilfile(:,:,1,time_out(l)) |
---|
| 1214 | ! And now put everything in the destination file |
---|
| 1215 | ! ... Header |
---|
| 1216 | write(1) IFV |
---|
| 1217 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1218 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1219 | ! ... Data |
---|
| 1220 | write(1) SLAB |
---|
| 1221 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1222 | |
---|
| 1223 | !------------------------! |
---|
| 1224 | ! >>> Write a variable ! |
---|
| 1225 | ! ... Copy&Paste part ! |
---|
| 1226 | !------------------------! |
---|
| 1227 | FIELD='ISOIL' |
---|
| 1228 | UNITS='tiu' |
---|
| 1229 | DESC='Soil thermal inertia' |
---|
| 1230 | XLVL=200100. |
---|
| 1231 | SLAB=isoilfile(:,:,1,time_out(l)) |
---|
| 1232 | ! And now put everything in the destination file |
---|
| 1233 | ! ... Header |
---|
| 1234 | write(1) IFV |
---|
| 1235 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1236 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1237 | ! ... Data |
---|
| 1238 | write(1) SLAB |
---|
| 1239 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1240 | |
---|
| 1241 | !------------------------! |
---|
| 1242 | ! >>> Write a variable ! |
---|
| 1243 | ! ... Copy&Paste part ! |
---|
| 1244 | !------------------------! |
---|
| 1245 | FIELD='CO2' |
---|
| 1246 | UNITS='kg/kg' |
---|
| 1247 | DESC='CO2 mixing ratio' |
---|
| 1248 | XLVL=200100. |
---|
| 1249 | SLAB=co2file(:,:,1,time_out(l)) |
---|
| 1250 | ! And now put everything in the destination file |
---|
| 1251 | ! ... Header |
---|
| 1252 | write(1) IFV |
---|
| 1253 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1254 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1255 | ! ... Data |
---|
| 1256 | write(1) SLAB |
---|
| 1257 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1258 | |
---|
| 1259 | !------------------------! |
---|
| 1260 | ! >>> Write a variable ! |
---|
| 1261 | ! ... Copy&Paste part ! |
---|
| 1262 | !------------------------! |
---|
| 1263 | FIELD='DUSTQ' |
---|
| 1264 | UNITS='kg/kg' |
---|
| 1265 | DESC='Dust mixing ratio' |
---|
| 1266 | XLVL=200100. |
---|
| 1267 | SLAB=dustfile(:,:,1,time_out(l)) |
---|
| 1268 | ! And now put everything in the destination file |
---|
| 1269 | ! ... Header |
---|
| 1270 | write(1) IFV |
---|
| 1271 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1272 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1273 | ! ... Data |
---|
| 1274 | write(1) SLAB |
---|
| 1275 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1276 | |
---|
| 1277 | !------------------------! |
---|
| 1278 | ! >>> Write a variable ! |
---|
| 1279 | ! ... Copy&Paste part ! |
---|
| 1280 | !------------------------! |
---|
| 1281 | FIELD='DUSTN' |
---|
| 1282 | UNITS='part/kg' |
---|
| 1283 | DESC='Dust number density' |
---|
| 1284 | XLVL=200100. |
---|
| 1285 | SLAB=dustnfile(:,:,1,time_out(l)) |
---|
| 1286 | ! And now put everything in the destination file |
---|
| 1287 | ! ... Header |
---|
| 1288 | write(1) IFV |
---|
| 1289 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1290 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1291 | ! ... Data |
---|
| 1292 | write(1) SLAB |
---|
| 1293 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1294 | |
---|
| 1295 | !------------------------! |
---|
| 1296 | ! >>> Write a variable ! |
---|
| 1297 | ! ... Copy&Paste part ! |
---|
| 1298 | !------------------------! |
---|
| 1299 | FIELD='CCNQ' |
---|
| 1300 | UNITS='kg/kg' |
---|
| 1301 | DESC='CCN mixing ratio' |
---|
| 1302 | XLVL=200100. |
---|
| 1303 | SLAB=ccnfile(:,:,1,time_out(l)) |
---|
| 1304 | ! And now put everything in the destination file |
---|
| 1305 | ! ... Header |
---|
| 1306 | write(1) IFV |
---|
| 1307 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1308 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1309 | ! ... Data |
---|
| 1310 | write(1) SLAB |
---|
| 1311 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1312 | |
---|
| 1313 | !------------------------! |
---|
| 1314 | ! >>> Write a variable ! |
---|
| 1315 | ! ... Copy&Paste part ! |
---|
| 1316 | !------------------------! |
---|
| 1317 | FIELD='CCNN' |
---|
| 1318 | UNITS='part/kg' |
---|
| 1319 | DESC='CCN number density' |
---|
| 1320 | XLVL=200100. |
---|
| 1321 | SLAB=ccnnfile(:,:,1,time_out(l)) |
---|
| 1322 | ! And now put everything in the destination file |
---|
| 1323 | ! ... Header |
---|
| 1324 | write(1) IFV |
---|
| 1325 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1326 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1327 | ! ... Data |
---|
| 1328 | write(1) SLAB |
---|
| 1329 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1330 | |
---|
| 1331 | |
---|
| 1332 | !------------------------! |
---|
| 1333 | ! >>> Write a variable ! |
---|
| 1334 | ! PHOTOCHEMISTRY ! |
---|
| 1335 | !------------------------! |
---|
| 1336 | #ifdef PHOTOCHEM |
---|
| 1337 | DO i=1,nchemtrac |
---|
| 1338 | FIELD=wtnom(i) |
---|
| 1339 | UNITS='units' |
---|
| 1340 | DESC='desc' |
---|
| 1341 | XLVL=200100. |
---|
| 1342 | SLAB=chemtrac(:,:,1,time_out(l),i) |
---|
| 1343 | ! And now put everything in the destination file |
---|
| 1344 | ! ... Header |
---|
| 1345 | write(1) IFV |
---|
| 1346 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1347 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1348 | ! ... Data |
---|
| 1349 | write(1) SLAB |
---|
| 1350 | ENDDO |
---|
| 1351 | #endif |
---|
| 1352 | |
---|
| 1353 | !!---------------------------------------------------- |
---|
| 1354 | !! Write file in intermediate format for WPS |
---|
| 1355 | !! 2. 3D meteorological data |
---|
| 1356 | !! >>> same stuff, but handle vertical profile |
---|
| 1357 | !! >>> !! XLVL must be decreasing (pressure levels) |
---|
| 1358 | !!---------------------------------------------------- |
---|
| 1359 | |
---|
| 1360 | !------------------------! |
---|
| 1361 | ! >>> Write a variable ! |
---|
| 1362 | ! ... Copy&Paste part ! |
---|
| 1363 | !------------------------! |
---|
| 1364 | FIELD='T' |
---|
| 1365 | UNITS='K' |
---|
| 1366 | DESC='Atmospheric temperature' |
---|
| 1367 | DO k = 1,altlen |
---|
| 1368 | XLVL=levels(k) |
---|
| 1369 | SLAB=tfile(:,:,k,time_out(l)) |
---|
| 1370 | ! And now put everything in the destination file |
---|
| 1371 | ! ... Header |
---|
| 1372 | write(1) IFV |
---|
| 1373 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1374 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1375 | ! ... Data |
---|
| 1376 | write(1) SLAB |
---|
| 1377 | END DO |
---|
| 1378 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1379 | |
---|
| 1380 | !------------------------! |
---|
| 1381 | ! >>> Write a variable ! |
---|
| 1382 | ! ... Copy&Paste part ! |
---|
| 1383 | !------------------------! |
---|
| 1384 | FIELD='U' |
---|
| 1385 | UNITS='m s{-1}' |
---|
| 1386 | DESC='Zonal wind' |
---|
| 1387 | DO k = 1,altlen |
---|
| 1388 | XLVL=levels(k) |
---|
| 1389 | SLAB=ufile(:,:,k,time_out(l)) |
---|
| 1390 | ! And now put everything in the destination file |
---|
| 1391 | ! ... Header |
---|
| 1392 | write(1) IFV |
---|
| 1393 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1394 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1395 | ! ... Data |
---|
| 1396 | write(1) SLAB |
---|
| 1397 | END DO |
---|
| 1398 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1399 | |
---|
| 1400 | !------------------------! |
---|
| 1401 | ! >>> Write a variable ! |
---|
| 1402 | ! ... Copy&Paste part ! |
---|
| 1403 | !------------------------! |
---|
| 1404 | FIELD='V' |
---|
| 1405 | UNITS='m s{-1}' |
---|
| 1406 | DESC='Meridional wind' |
---|
| 1407 | DO k = 1,altlen |
---|
| 1408 | XLVL=levels(k) |
---|
| 1409 | SLAB=vfile(:,:,k,time_out(l)) |
---|
| 1410 | ! And now put everything in the destination file |
---|
| 1411 | ! ... Header |
---|
| 1412 | write(1) IFV |
---|
| 1413 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1414 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1415 | ! ... Data |
---|
| 1416 | write(1) SLAB |
---|
| 1417 | END DO |
---|
| 1418 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1419 | |
---|
| 1420 | !------------------------! |
---|
| 1421 | ! >>> Write a variable ! |
---|
| 1422 | ! ... Copy&Paste part ! |
---|
| 1423 | !------------------------! |
---|
| 1424 | FIELD='RH' |
---|
| 1425 | UNITS='' |
---|
| 1426 | DESC='Customized 2D static field' |
---|
| 1427 | DESC='Eta-levels from the GCM' |
---|
| 1428 | DESC='Pressure values from the GCM' |
---|
| 1429 | DO k = 1,altlen |
---|
| 1430 | XLVL=levels(k) |
---|
| 1431 | SELECT CASE(ident) |
---|
| 1432 | CASE('LMD') |
---|
| 1433 | SLAB=aps(k)+bps(k)*psfile(:,:,time_out(l)) |
---|
| 1434 | CASE('OXF') |
---|
| 1435 | SLAB=bps(k)*psfile(:,:,time_out(l)) |
---|
| 1436 | END SELECT |
---|
| 1437 | ! And now put everything in the destination file |
---|
| 1438 | ! ... Header |
---|
| 1439 | write(1) IFV |
---|
| 1440 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1441 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1442 | ! ... Data |
---|
| 1443 | write(1) SLAB |
---|
| 1444 | END DO |
---|
| 1445 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1446 | |
---|
| 1447 | !------------------------! |
---|
| 1448 | ! >>> Write a variable ! |
---|
| 1449 | ! ... Copy&Paste part ! |
---|
| 1450 | !------------------------! |
---|
| 1451 | FIELD='HGT' |
---|
| 1452 | UNITS='m' |
---|
| 1453 | DESC='Height' |
---|
| 1454 | DO k = 1,altlen |
---|
| 1455 | XLVL=levels(k) |
---|
| 1456 | !!******* |
---|
| 1457 | !! PROVISOIRE: normalement, il faudrait la hauteur geopotentielle |
---|
| 1458 | !!******* |
---|
| 1459 | !!however, not used by initialize_real |
---|
| 1460 | SELECT CASE(ident) |
---|
| 1461 | CASE('LMD') |
---|
| 1462 | SLAB=10000.*alog(610./(aps(k)+bps(k)*psfile(:,:,time_out(l)))) |
---|
| 1463 | CASE('OXF') |
---|
| 1464 | SLAB=10000.*alog(610./(bps(k)*psfile(:,:,time_out(l)))) |
---|
| 1465 | END SELECT |
---|
| 1466 | ! And now put everything in the destination file |
---|
| 1467 | ! ... Header |
---|
| 1468 | write(1) IFV |
---|
| 1469 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1470 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1471 | ! ... Data |
---|
| 1472 | write(1) SLAB |
---|
| 1473 | END DO |
---|
| 1474 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1475 | |
---|
| 1476 | !------------------------! |
---|
| 1477 | ! >>> Write a variable ! |
---|
| 1478 | ! ... Copy&Paste part ! |
---|
| 1479 | !------------------------! |
---|
| 1480 | FIELD='HV' |
---|
| 1481 | UNITS='kg/kg' |
---|
| 1482 | DESC='Water vapor' |
---|
| 1483 | DO k = 1,altlen |
---|
| 1484 | XLVL=levels(k) |
---|
| 1485 | SLAB=waterfile(:,:,k,time_out(l)) |
---|
| 1486 | ! And now put everything in the destination file |
---|
| 1487 | ! ... Header |
---|
| 1488 | write(1) IFV |
---|
| 1489 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1490 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1491 | ! ... Data |
---|
| 1492 | write(1) SLAB |
---|
| 1493 | END DO |
---|
| 1494 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1495 | |
---|
| 1496 | !------------------------! |
---|
| 1497 | ! >>> Write a variable ! |
---|
| 1498 | ! ... Copy&Paste part ! |
---|
| 1499 | !------------------------! |
---|
| 1500 | FIELD='HI' |
---|
| 1501 | UNITS='kg/kg' |
---|
| 1502 | DESC='Water ice' |
---|
| 1503 | DO k = 1,altlen |
---|
| 1504 | XLVL=levels(k) |
---|
| 1505 | SLAB=watericefile(:,:,k,time_out(l)) |
---|
| 1506 | ! And now put everything in the destination file |
---|
| 1507 | ! ... Header |
---|
| 1508 | write(1) IFV |
---|
| 1509 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1510 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1511 | ! ... Data |
---|
| 1512 | write(1) SLAB |
---|
| 1513 | END DO |
---|
| 1514 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1515 | |
---|
| 1516 | !------------------------! |
---|
| 1517 | ! >>> Write a variable ! |
---|
| 1518 | ! ... Copy&Paste part ! |
---|
| 1519 | !------------------------! |
---|
| 1520 | FIELD='TSOIL' |
---|
| 1521 | UNITS='K' |
---|
| 1522 | DESC='Soil temperature' |
---|
| 1523 | DO k = 1,altlen |
---|
| 1524 | XLVL=levels(k) |
---|
| 1525 | SLAB=tsoilfile(:,:,k,time_out(l)) |
---|
| 1526 | ! And now put everything in the destination file |
---|
| 1527 | ! ... Header |
---|
| 1528 | write(1) IFV |
---|
| 1529 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1530 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1531 | ! ... Data |
---|
| 1532 | write(1) SLAB |
---|
| 1533 | END DO |
---|
| 1534 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1535 | |
---|
| 1536 | !------------------------! |
---|
| 1537 | ! >>> Write a variable ! |
---|
| 1538 | ! ... Copy&Paste part ! |
---|
| 1539 | !------------------------! |
---|
| 1540 | FIELD='DSOIL' |
---|
| 1541 | UNITS='m' |
---|
| 1542 | DESC='Soil depths' |
---|
| 1543 | DO k = 1,altlen |
---|
| 1544 | XLVL=levels(k) |
---|
| 1545 | SLAB=dsoilfile(:,:,k,time_out(l)) |
---|
| 1546 | ! And now put everything in the destination file |
---|
| 1547 | ! ... Header |
---|
| 1548 | write(1) IFV |
---|
| 1549 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1550 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1551 | ! ... Data |
---|
| 1552 | write(1) SLAB |
---|
| 1553 | END DO |
---|
| 1554 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1555 | |
---|
| 1556 | !------------------------! |
---|
| 1557 | ! >>> Write a variable ! |
---|
| 1558 | ! ... Copy&Paste part ! |
---|
| 1559 | !------------------------! |
---|
| 1560 | FIELD='ISOIL' |
---|
| 1561 | UNITS='tiu' |
---|
| 1562 | DESC='Soil thermal inertia' |
---|
| 1563 | DO k = 1,altlen |
---|
| 1564 | XLVL=levels(k) |
---|
| 1565 | SLAB=isoilfile(:,:,k,time_out(l)) |
---|
| 1566 | ! And now put everything in the destination file |
---|
| 1567 | ! ... Header |
---|
| 1568 | write(1) IFV |
---|
| 1569 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1570 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1571 | ! ... Data |
---|
| 1572 | write(1) SLAB |
---|
| 1573 | END DO |
---|
| 1574 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1575 | |
---|
| 1576 | !------------------------! |
---|
| 1577 | ! >>> Write a variable ! |
---|
| 1578 | ! ... Copy&Paste part ! |
---|
| 1579 | !------------------------! |
---|
| 1580 | FIELD='CO2' |
---|
| 1581 | UNITS='kg/kg' |
---|
| 1582 | DESC='CO2 mixing ratio' |
---|
| 1583 | DO k = 1,altlen |
---|
| 1584 | XLVL=levels(k) |
---|
| 1585 | SLAB=co2file(:,:,k,time_out(l)) |
---|
| 1586 | ! And now put everything in the destination file |
---|
| 1587 | ! ... Header |
---|
| 1588 | write(1) IFV |
---|
| 1589 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1590 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1591 | ! ... Data |
---|
| 1592 | write(1) SLAB |
---|
| 1593 | END DO |
---|
| 1594 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1595 | |
---|
| 1596 | !------------------------! |
---|
| 1597 | ! >>> Write a variable ! |
---|
| 1598 | ! ... Copy&Paste part ! |
---|
| 1599 | !------------------------! |
---|
| 1600 | FIELD='DUSTQ' |
---|
| 1601 | UNITS='kg/kg' |
---|
| 1602 | DESC='Dust mixing ratio' |
---|
| 1603 | DO k = 1,altlen |
---|
| 1604 | XLVL=levels(k) |
---|
| 1605 | SLAB=dustfile(:,:,k,time_out(l)) |
---|
| 1606 | ! And now put everything in the destination file |
---|
| 1607 | ! ... Header |
---|
| 1608 | write(1) IFV |
---|
| 1609 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1610 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1611 | ! ... Data |
---|
| 1612 | write(1) SLAB |
---|
| 1613 | END DO |
---|
| 1614 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1615 | |
---|
| 1616 | !------------------------! |
---|
| 1617 | ! >>> Write a variable ! |
---|
| 1618 | ! ... Copy&Paste part ! |
---|
| 1619 | !------------------------! |
---|
| 1620 | FIELD='DUSTN' |
---|
| 1621 | UNITS='part/kg' |
---|
| 1622 | DESC='Dust number density' |
---|
| 1623 | DO k = 1,altlen |
---|
| 1624 | XLVL=levels(k) |
---|
| 1625 | SLAB=dustnfile(:,:,k,time_out(l)) |
---|
| 1626 | ! And now put everything in the destination file |
---|
| 1627 | ! ... Header |
---|
| 1628 | write(1) IFV |
---|
| 1629 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1630 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1631 | ! ... Data |
---|
| 1632 | write(1) SLAB |
---|
| 1633 | END DO |
---|
| 1634 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1635 | |
---|
| 1636 | !------------------------! |
---|
| 1637 | ! >>> Write a variable ! |
---|
| 1638 | ! ... Copy&Paste part ! |
---|
| 1639 | !------------------------! |
---|
| 1640 | FIELD='CCNQ' |
---|
| 1641 | UNITS='kg/kg' |
---|
| 1642 | DESC='CCN mixing ratio' |
---|
| 1643 | DO k = 1,altlen |
---|
| 1644 | XLVL=levels(k) |
---|
| 1645 | SLAB=ccnfile(:,:,k,time_out(l)) |
---|
| 1646 | ! And now put everything in the destination file |
---|
| 1647 | ! ... Header |
---|
| 1648 | write(1) IFV |
---|
| 1649 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1650 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1651 | ! ... Data |
---|
| 1652 | write(1) SLAB |
---|
| 1653 | END DO |
---|
| 1654 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1655 | |
---|
| 1656 | !------------------------! |
---|
| 1657 | ! >>> Write a variable ! |
---|
| 1658 | ! ... Copy&Paste part ! |
---|
| 1659 | !------------------------! |
---|
| 1660 | FIELD='CCNN' |
---|
| 1661 | UNITS='part/kg' |
---|
| 1662 | DESC='CCN number density' |
---|
| 1663 | DO k = 1,altlen |
---|
| 1664 | XLVL=levels(k) |
---|
| 1665 | SLAB=ccnnfile(:,:,k,time_out(l)) |
---|
| 1666 | ! And now put everything in the destination file |
---|
| 1667 | ! ... Header |
---|
| 1668 | write(1) IFV |
---|
| 1669 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1670 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1671 | ! ... Data |
---|
| 1672 | write(1) SLAB |
---|
| 1673 | END DO |
---|
| 1674 | !print *,'The field '//DESC//' was written to '//output |
---|
| 1675 | |
---|
| 1676 | |
---|
| 1677 | !------------------------! |
---|
| 1678 | ! >>> Write a variable ! |
---|
| 1679 | ! PHOTOCHEMISTRY ! |
---|
| 1680 | !------------------------! |
---|
| 1681 | #ifdef PHOTOCHEM |
---|
| 1682 | DO i=1,nchemtrac |
---|
| 1683 | FIELD=wtnom(i) |
---|
| 1684 | UNITS='units' |
---|
| 1685 | DESC='desc' |
---|
| 1686 | DO k = 1,altlen |
---|
| 1687 | XLVL=levels(k) |
---|
| 1688 | SLAB=chemtrac(:,:,k,time_out(l),i) |
---|
| 1689 | ! And now put everything in the destination file |
---|
| 1690 | ! ... Header |
---|
| 1691 | write(1) IFV |
---|
| 1692 | write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ |
---|
| 1693 | write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON |
---|
| 1694 | ! ... Data |
---|
| 1695 | write(1) SLAB |
---|
| 1696 | END DO |
---|
| 1697 | ENDDO |
---|
| 1698 | #endif |
---|
| 1699 | |
---|
| 1700 | print *,'****done file '//output, int(100.*float(l)/float(FILES)), ' % ' |
---|
| 1701 | close(1) |
---|
| 1702 | |
---|
| 1703 | DEALLOCATE(SLAB) |
---|
| 1704 | |
---|
| 1705 | END DO !! end of the files loop |
---|
| 1706 | |
---|
| 1707 | |
---|
| 1708 | !!------------------------- |
---|
| 1709 | !! DeAllocate local arrays |
---|
| 1710 | !!------------------------- |
---|
| 1711 | deallocate(eta_gcm) |
---|
| 1712 | deallocate(tfile) |
---|
| 1713 | deallocate(tsoilfile) |
---|
| 1714 | deallocate(isoilfile) |
---|
| 1715 | deallocate(dsoilfile) |
---|
| 1716 | !deallocate(tfileorig) |
---|
| 1717 | deallocate(ufile) |
---|
| 1718 | !deallocate(ufileorig) |
---|
| 1719 | deallocate(vfile) |
---|
| 1720 | !deallocate(vfileorig) |
---|
| 1721 | deallocate(rfile) |
---|
| 1722 | deallocate(hfile) |
---|
| 1723 | deallocate(waterfile) |
---|
| 1724 | deallocate(watericefile) |
---|
| 1725 | !deallocate(swaterfile) |
---|
| 1726 | deallocate(swatericefile) |
---|
| 1727 | deallocate(dustfile) |
---|
| 1728 | deallocate(dustnfile) |
---|
| 1729 | deallocate(co2file) |
---|
| 1730 | deallocate(ccnfile) |
---|
| 1731 | deallocate(ccnnfile) |
---|
| 1732 | deallocate(psfile) |
---|
| 1733 | deallocate(tsfile) |
---|
| 1734 | deallocate(tnsfile) |
---|
| 1735 | deallocate(unsfile) |
---|
| 1736 | deallocate(vnsfile) |
---|
| 1737 | deallocate(emissfile) |
---|
| 1738 | deallocate(co2icefile) |
---|
| 1739 | deallocate(ghtsfile) !! no scan axis |
---|
| 1740 | deallocate(vide) |
---|
| 1741 | deallocate(ones) |
---|
| 1742 | deallocate(lat, lon, alt, time) |
---|
| 1743 | deallocate(aps,bps,levels) |
---|
| 1744 | |
---|
| 1745 | #ifdef PHOTOCHEM |
---|
| 1746 | deallocate(chemtrac) |
---|
| 1747 | deallocate(wtnom) |
---|
| 1748 | #endif |
---|
| 1749 | |
---|
| 1750 | print *, '------------------------' |
---|
| 1751 | print *, 'End of pre-WPS process !' |
---|
| 1752 | print *, '------------------------' |
---|
| 1753 | print *, 'Here is what you should set in namelist.wps:' |
---|
| 1754 | print *, " start_date = '"//date_out2(1)//"'" |
---|
| 1755 | print *, " end_date = '"//date_out2(FILES)//"'" |
---|
| 1756 | print *, '------------------------' |
---|
| 1757 | print *, 'Any date between those is ok' |
---|
| 1758 | print *, 'for example, second available date is ... '//date_out2(2) |
---|
| 1759 | print *, '------------------------' |
---|
| 1760 | |
---|
| 1761 | end |
---|