Changeset 2327 for trunk/LMDZ.MARS/util
- Timestamp:
- May 18, 2020, 6:25:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/aeroptical.F90
r2318 r2327 74 74 character(len=16) :: tmpvarname ! temporarily stores a variable name 75 75 real,dimension(:,:,:,:,:),allocatable :: opa_aer ! Aerosols opacities [1/km] 76 real :: missval! Value to put in outfile when the reff is out of bounds77 PARAMETER(missval=1E+20) 76 real,dimension(:),allocatable :: missval ! Value to put in outfile when the reff is out of bounds 77 ! or when there is a mising value in input file 78 78 79 79 … … 179 179 allocate(mmr(naerkind,lonlen,latlen,altlen,timelen)) 180 180 allocate(reff(naerkind,lonlen,latlen,altlen,timelen)) 181 182 ! Initialize missing value 183 allocate(missval(naerkind)) 184 missval(:)=1.e+20 181 185 182 186 ! Initialize aerok to .true. for all aerosols … … 201 205 call status_check(ierr,error_text) 202 206 write(*,*) "Dust mass mixing ratio loaded from "//trim(gcmfile) 207 ! Get missing value 208 ierr=nf90_get_att(gcmfid,tmpvarid,"missing_value",missval(1)) 209 if (ierr.ne.nf90_noerr) then 210 missval(1) = 1.e+20 211 endif 203 212 endif 204 213 … … 238 247 call status_check(ierr,error_text) 239 248 write(*,*) "Water ice mass mixing ratio loaded from "//trim(gcmfile) 249 ! Get missing value 250 ierr=nf90_get_att(gcmfid,tmpvarid,"missing_value",missval(2)) 251 if (ierr.ne.nf90_noerr) then 252 missval(2) = 1.e+20 253 endif 240 254 endif 241 255 … … 532 546 ierr=nf90_put_att(outfid,tmpvaridout,"units","opacity/km") 533 547 ierr=nf90_put_att(outfid,tmpvaridout,"refwavelength",wvl_val) 534 ierr=nf90_put_att(outfid,tmpvaridout,"missing_value",missval )535 write(*,*)"with missing value = ",missval 548 ierr=nf90_put_att(outfid,tmpvaridout,"missing_value",missval(iaer)) 549 write(*,*)"with missing value = ",missval(iaer) 536 550 537 551 ! End netcdf define mode … … 557 571 558 572 ! NB: this should especially handle cases when reff=0 559 opa_aer(iaer,ilon,ilat,ialt,it)=missval 573 opa_aer(iaer,ilon,ilat,ialt,it)=missval(iaer) 574 575 else if (mmr(iaer,ilon,ilat,ialt,it).eq.missval(iaer)) then 576 ! if there is a missing value in input file 577 opa_aer(iaer,ilon,ilat,ialt,it)=missval(iaer) 578 560 579 else 561 580 if (radiusdyn(isize).eq.reff(iaer,ilon,ilat,ialt,it)) then … … 1049 1068 integer, intent(in) :: lonlen ! # of grid points along longitude 1050 1069 integer, intent(in) :: latlen ! # of grid points along latitude 1051 integer, intent(in) :: altlen ! # of grid points along latitude1070 integer, intent(in) :: altlen ! # of grid points along altitude 1052 1071 integer, intent(in) :: GCM_layers ! # of GCM atmospheric layers 1053 1072 integer, intent(in) :: outfid ! NetCDF output file ID … … 1204 1223 1205 1224 !============================================================================== 1206 ! 2. 2.Hybrid coordinates ap() , bp(), aps() and bps()1225 ! 2.1 Hybrid coordinates ap() , bp(), aps() and bps() 1207 1226 !============================================================================== 1208 1227 if(hybrid) then … … 1216 1235 endif 1217 1236 ! Write the attributes 1218 ierr=nf90_put_att(outfid,tmpvarid," title","hybrid pressure at midlayers")1237 ierr=nf90_put_att(outfid,tmpvarid,"long_name","hybrid pressure at midlayers") 1219 1238 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1220 1239 ! End netcdf define mode … … 1236 1255 endif 1237 1256 ! Write the attributes 1238 ierr=nf90_put_att(outfid,tmpvarid," title","hybrid sigma at midlayers")1257 ierr=nf90_put_att(outfid,tmpvarid,"long_name","hybrid sigma at midlayers") 1239 1258 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1240 1259 ! End netcdf define mode … … 1258 1277 endif 1259 1278 ! Write the attributes 1260 ierr=nf90_put_att(outfid,tmpvarid," title","hybrid sigma at interlayers")1279 ierr=nf90_put_att(outfid,tmpvarid,"long_name","hybrid sigma at interlayers") 1261 1280 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1262 1281 ! End netcdf define mode … … 1279 1298 endif 1280 1299 ! Write the attributes 1281 ierr=nf90_put_att(outfid,tmpvarid," title","hybrid sigma at interlayers")1300 ierr=nf90_put_att(outfid,tmpvarid,"long_name","hybrid sigma at interlayers") 1282 1301 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1283 1302 ! End netcdf define mode … … 1301 1320 endif 1302 1321 ! Write the attributes 1303 ierr=nf90_put_att(outfid,tmpvarid," title","sigma at midlayers")1322 ierr=nf90_put_att(outfid,tmpvarid,"long_name","sigma at midlayers") 1304 1323 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1305 1324 ! End netcdf define mode … … 1314 1333 1315 1334 !============================================================================== 1316 ! 2.2 .aire() and phisinit()1335 ! 2.2 aire() and phisinit() 1317 1336 !============================================================================== 1318 1337 … … 1327 1346 endif 1328 1347 ! Write the attributes 1329 ierr=nf90_put_att(outfid,tmpvarid," title","Mesh area")1348 ierr=nf90_put_att(outfid,tmpvarid,"long_name","Mesh area") 1330 1349 ierr=nf90_put_att(outfid,tmpvarid,"units","m2") 1331 1350 ! End netcdf define mode … … 1339 1358 endif ! of if (area) 1340 1359 1341 IF (phis) THEN 1360 if (phis) then 1342 1361 1343 1362 ! Switch to netcdf define mode … … 1349 1368 endif 1350 1369 ! Write the attributes 1351 ierr=nf90_put_att(outfid,tmpvarid," title","Ground level geopotential")1370 ierr=nf90_put_att(outfid,tmpvarid,"long_name","Ground level geopotential") 1352 1371 ierr=nf90_put_att(outfid,tmpvarid,"units"," ") 1353 1372 ! End netcdf define mode … … 1360 1379 endif 1361 1380 1362 ENDIF ! of IF(phis)1381 endif ! of if (phis) 1363 1382 1364 1383
Note: See TracChangeset
for help on using the changeset viewer.