@@ -7,7 +7,9 @@ module mod_cosp_io
77 tau_binEdges,npres, pres_binBounds, pres_binCenters, pres_binEdges, nhgt, &
88 hgt_binBounds, hgt_binCenters, hgt_binEdges, reffLIQ_binCenters,vgrid_z, &
99 reffICE_binCenters, reffLIQ_binCenters, cloudsat_binCenters, PARASOL_SZA, &
10- calipso_binCenters, grLidar532_binCenters, atlid_binCenters
10+ calipso_binCenters, grLidar532_binCenters, atlid_binCenters, &
11+ CFODD_NDBZE, CFODD_HISTDBZE, CFODD_HISTDBZEcenters, &
12+ CFODD_NICOD, CFODD_HISTICOD, CFODD_HISTICODcenters
1113 implicit none
1214
1315contains
@@ -73,6 +75,10 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
7375 if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
7476 status = nf90_def_dim(fileID," REICE_MODIS" ,numMODISReffIceBins,dimID(16 ))
7577 if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
78+ status = nf90_def_dim(fileID," CFODD_NDBZE" ,CFODD_NDBZE,dimID(17 ))
79+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
80+ status = nf90_def_dim(fileID," CFODD_NICOD" ,CFODD_NICOD,dimID(18 ))
81+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
7682
7783 ! ---------------------------------------------------------------------------------------
7884 ! Define varaibles
@@ -1339,7 +1345,77 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
13391345 status = nf90_put_att(fileID,varID(139 )," standard_name" , " cloud_area_fraction" )
13401346 if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
13411347 endif
1342-
1348+ ! warm-rain occurrence frequency diagnostics
1349+ if (associated (cospOUT% wr_occfreq_ntotal)) then
1350+ status = nf90_def_var(fileID," npdfcld" ,nf90_float, (/ dimID(1 )/ ),varID(140 ))
1351+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1352+ status = nf90_put_att(fileID,varID(140 )," long_name" ," # of Non-Precipitating Clouds" )
1353+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1354+ status = nf90_put_att(fileID,varID(140 )," units" , " 1" )
1355+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1356+ status = nf90_put_att(fileID,varID(140 )," standard_name" , " number_of_slwc_nonprecip" )
1357+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1358+ status = nf90_def_var(fileID," npdfdrz" ,nf90_float, (/ dimID(1 )/ ),varID(141 ))
1359+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1360+ status = nf90_put_att(fileID,varID(141 )," long_name" ," # of Drizzling Clouds" )
1361+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1362+ status = nf90_put_att(fileID,varID(141 )," units" , " 1" )
1363+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1364+ status = nf90_put_att(fileID,varID(141 )," standard_name" , " number_of_slwc_drizzle" )
1365+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1366+ status = nf90_def_var(fileID," npdfrain" ,nf90_float, (/ dimID(1 )/ ),varID(142 ))
1367+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1368+ status = nf90_put_att(fileID,varID(142 )," long_name" ," # of Precipitating Clouds" )
1369+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1370+ status = nf90_put_att(fileID,varID(142 )," units" , " 1" )
1371+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1372+ status = nf90_put_att(fileID,varID(142 )," standard_name" , " number_of_slwc_precip" )
1373+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1374+ endif
1375+ ! Contoured Frequency by Optical Depth Diagram (CFODD)
1376+ if (associated (cospOUT% cfodd_ntotal)) then
1377+ status = nf90_def_var(fileID," ncfodd1" ,nf90_float, (/ dimID(1 ),dimID(17 ),dimID(18 )/ ),varID(143 ))
1378+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1379+ status = nf90_put_att(fileID,varID(143 )," long_name" ," # of CFODD (05 < Reff < 12 micron)" )
1380+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1381+ status = nf90_put_att(fileID,varID(143 )," units" , " 1" )
1382+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1383+ status = nf90_put_att(fileID,varID(143 )," standard_name" , " cfodd_reff_small" )
1384+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1385+ status = nf90_def_var(fileID," ncfodd2" ,nf90_float, (/ dimID(1 ),dimID(17 ),dimID(18 )/ ),varID(144 ))
1386+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1387+ status = nf90_put_att(fileID,varID(144 )," long_name" ," # of CFODD (12 < Reff < 18 micron)" )
1388+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1389+ status = nf90_put_att(fileID,varID(144 )," units" , " 1" )
1390+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1391+ status = nf90_put_att(fileID,varID(144 )," standard_name" , " cfodd_reff_medium" )
1392+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1393+ status = nf90_def_var(fileID," ncfodd3" ,nf90_float, (/ dimID(1 ),dimID(17 ),dimID(18 )/ ),varID(145 ))
1394+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1395+ status = nf90_put_att(fileID,varID(145 )," long_name" ," # of CFODD (18 < Reff < 35 micron)" )
1396+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1397+ status = nf90_put_att(fileID,varID(145 )," units" , " 1" )
1398+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1399+ status = nf90_put_att(fileID,varID(145 )," standard_name" , " cfodd_reff_large" )
1400+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1401+ ! ! axes for CFODD
1402+ status = nf90_def_var(fileID," CFODD_NDBZE" ,nf90_float,(/ dimID(17 )/ ),varID(146 ))
1403+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1404+ status = nf90_put_att(fileID,varID(146 )," long_name" ," CloudSat+MODIS dBZe vs ICOD joint PDF X-axis" )
1405+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1406+ status = nf90_put_att(fileID,varID(146 )," units" , " dBZ" )
1407+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1408+ status = nf90_put_att(fileID,varID(146 )," standard_name" , " cloudsat_quivalent_reflectivity_factor" )
1409+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1410+ status = nf90_def_var(fileID," CFODD_NICOD" ,nf90_float,(/ dimID(18 )/ ),varID(147 ))
1411+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1412+ status = nf90_put_att(fileID,varID(147 )," long_name" ," CloudSat+MODIS dBZe vs ICOD joint PDF Y-axis" )
1413+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1414+ status = nf90_put_att(fileID,varID(147 )," units" , " none" )
1415+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1416+ status = nf90_put_att(fileID,varID(147 )," standard_name" , " modis_in-cloud_optical_depth" )
1417+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1418+ endif
13431419
13441420 ! ---------------------------------------------------------------------------------------
13451421 ! Exit define mode
@@ -1794,6 +1870,30 @@ subroutine write_cosp2_output(Npoints, Ncolumns, Nlevels, lev, lon, lat, cospOUT
17941870 if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
17951871 endif
17961872
1873+ ! Cloudsat+MODIS Joint simulators output
1874+ ! ! warm-rain occurrence frequency diagnostics
1875+ if (associated (cospOUT% wr_occfreq_ntotal)) then
1876+ status = nf90_put_var(fileID,varID(140 ),cospOUT% wr_occfreq_ntotal(:,1 ))
1877+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1878+ status = nf90_put_var(fileID,varID(141 ),cospOUT% wr_occfreq_ntotal(:,2 ))
1879+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1880+ status = nf90_put_var(fileID,varID(142 ),cospOUT% wr_occfreq_ntotal(:,3 ))
1881+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1882+ endif
1883+ ! ! Contoured Frequency by Optical Depth Diagram (CFODD)
1884+ if (associated (cospOUT% cfodd_ntotal)) then
1885+ status = nf90_put_var(fileID,varID(143 ),cospOUT% cfodd_ntotal(:,:,:,1 ))
1886+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1887+ status = nf90_put_var(fileID,varID(144 ),cospOUT% cfodd_ntotal(:,:,:,2 ))
1888+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1889+ status = nf90_put_var(fileID,varID(145 ),cospOUT% cfodd_ntotal(:,:,:,3 ))
1890+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1891+ status = nf90_put_var(fileID,varID(146 ),CFODD_HISTDBZEcenters)
1892+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1893+ status = nf90_put_var(fileID,varID(147 ),CFODD_HISTICODcenters)
1894+ if (status .ne. nf90_NoERR) print * ,trim (nf90_strerror(status))
1895+ endif
1896+
17971897
17981898 ! Close file
17991899 status = nf90_close(fileID)
0 commit comments