Changeset 1352 for LMDZ4/trunk
- Timestamp:
- Apr 14, 2010, 11:41:19 AM (15 years ago)
- Location:
- LMDZ4/trunk/libf/phylmd
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/calcul_STDlev.h
r1146 r1352 3 3 c 4 4 c 5 cIM on initialise les champs en debut du jour ou du mois5 cIM on initialise les variables 6 6 c 7 CALL ini_undefSTD(nlevSTD,itap, 8 $ dtime,ecrit_day,ecrit_mth, 9 $ tnondef,tsumSTD) 10 CALL ini_undefSTD(nlevSTD,itap, 11 $ dtime,ecrit_day,ecrit_mth, 12 $ tnondef,usumSTD) 13 CALL ini_undefSTD(nlevSTD,itap, 14 $ dtime,ecrit_day,ecrit_mth, 15 $ tnondef,vsumSTD) 16 CALL ini_undefSTD(nlevSTD,itap, 17 $ dtime,ecrit_day,ecrit_mth, 18 $ tnondef,wsumSTD) 19 CALL ini_undefSTD(nlevSTD,itap, 20 $ dtime,ecrit_day,ecrit_mth, 21 $ tnondef,phisumSTD) 22 CALL ini_undefSTD(nlevSTD,itap, 23 $ dtime,ecrit_day,ecrit_mth, 24 $ tnondef,qsumSTD) 25 CALL ini_undefSTD(nlevSTD,itap, 26 $ dtime,ecrit_day,ecrit_mth, 27 $ tnondef,rhsumSTD) 28 CALL ini_undefSTD(nlevSTD,itap, 29 $ dtime,ecrit_day,ecrit_mth, 30 $ tnondef,uvsumSTD) 31 CALL ini_undefSTD(nlevSTD,itap, 32 $ dtime,ecrit_day,ecrit_mth, 33 $ tnondef,vqsumSTD) 34 CALL ini_undefSTD(nlevSTD,itap, 35 $ dtime,ecrit_day,ecrit_mth, 36 $ tnondef,vTsumSTD) 37 CALL ini_undefSTD(nlevSTD,itap, 38 $ dtime,ecrit_day,ecrit_mth, 39 $ tnondef,wqsumSTD) 40 CALL ini_undefSTD(nlevSTD,itap, 41 $ dtime,ecrit_day,ecrit_mth, 42 $ tnondef,vphisumSTD) 43 CALL ini_undefSTD(nlevSTD,itap, 44 $ dtime,ecrit_day,ecrit_mth, 45 $ tnondef,wTsumSTD) 46 CALL ini_undefSTD(nlevSTD,itap, 47 $ dtime,ecrit_day,ecrit_mth, 48 $ tnondef,u2sumSTD) 49 CALL ini_undefSTD(nlevSTD,itap, 50 $ dtime,ecrit_day,ecrit_mth, 51 $ tnondef,v2sumSTD) 52 CALL ini_undefSTD(nlevSTD,itap, 53 $ dtime,ecrit_day,ecrit_mth, 54 $ tnondef,T2sumSTD) 7 CALL ini_undefSTD(itap,freq_outNMC) 55 8 c 56 cIM on interpole sur les niveaux STD de pression a chaque pas de temps de la physique 9 cIM on interpole les champs sur les niveaux STD de pression 10 cIM a chaque pas de temps de la physique 57 11 c 58 12 c-------------------------------------------------------c … … 163 117 164 118 c 165 cIM on somme les valeurs definies a chaque pas de temps de la physique ou 166 cIM toutes les 6 heures 119 cIM on somme les valeurs toutes les freq_calNMC secondes 167 120 c 168 oknondef(1:klon,1:nlevSTD,1:nout)=.TRUE. 169 CALL undefSTD(nlevSTD,itap,tlevSTD, 170 $ dtime,ecrit_hf, 171 $ oknondef,tnondef,tsumSTD) 121 CALL undefSTD(itap,freq_calNMC) 172 122 c 173 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 174 CALL undefSTD(nlevSTD,itap,ulevSTD, 175 $ dtime,ecrit_hf, 176 $ oknondef,tnondef,usumSTD) 123 cIM on moyenne a la fin du mois ou du jour (toutes les freq_outNMC secondes) 177 124 c 178 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 179 CALL undefSTD(nlevSTD,itap,vlevSTD, 180 $ dtime,ecrit_hf, 181 $ oknondef,tnondef,vsumSTD) 125 CALL moy_undefSTD(itap,freq_outNMC,freq_moyNMC) 182 126 c 183 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 184 CALL undefSTD(nlevSTD,itap,wlevSTD, 185 $ dtime,ecrit_hf, 186 $ oknondef,tnondef,wsumSTD) 187 c 188 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 189 CALL undefSTD(nlevSTD,itap,philevSTD, 190 $ dtime,ecrit_hf, 191 $ oknondef,tnondef,phisumSTD) 192 c 193 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 194 CALL undefSTD(nlevSTD,itap,qlevSTD, 195 $ dtime,ecrit_hf, 196 $ oknondef,tnondef,qsumSTD) 197 c 198 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 199 CALL undefSTD(nlevSTD,itap,rhlevSTD, 200 $ dtime,ecrit_hf, 201 $ oknondef,tnondef,rhsumSTD) 202 c 203 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 204 CALL undefSTD(nlevSTD,itap,uvSTD, 205 $ dtime,ecrit_hf, 206 $ oknondef,tnondef,uvsumSTD) 207 c 208 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 209 CALL undefSTD(nlevSTD,itap,vqSTD, 210 $ dtime,ecrit_hf, 211 $ oknondef,tnondef,vqsumSTD) 212 c 213 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 214 CALL undefSTD(nlevSTD,itap,vTSTD, 215 $ dtime,ecrit_hf, 216 $ oknondef,tnondef,vTsumSTD) 217 c 218 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 219 CALL undefSTD(nlevSTD,itap,wqSTD, 220 $ dtime,ecrit_hf, 221 $ oknondef,tnondef,wqsumSTD) 222 c 223 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 224 CALL undefSTD(nlevSTD,itap,vphiSTD, 225 $ dtime,ecrit_hf, 226 $ oknondef,tnondef,vphisumSTD) 227 c 228 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 229 CALL undefSTD(nlevSTD,itap,wTSTD, 230 $ dtime,ecrit_hf, 231 $ oknondef,tnondef,wTsumSTD) 232 c 233 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 234 CALL undefSTD(nlevSTD,itap,u2STD, 235 $ dtime,ecrit_hf, 236 $ oknondef,tnondef,u2sumSTD) 237 c 238 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 239 CALL undefSTD(nlevSTD,itap,v2STD, 240 $ dtime,ecrit_hf, 241 $ oknondef,tnondef,v2sumSTD) 242 c 243 oknondef(1:klon,1:nlevSTD,1:nout)=.FALSE. 244 CALL undefSTD(nlevSTD,itap,T2STD, 245 $ dtime,ecrit_hf, 246 $ oknondef,tnondef,T2sumSTD) 247 c 248 cIM on moyenne a la fin du jour ou du mois 249 c 250 CALL moy_undefSTD(nlevSTD,itap, 251 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 252 $ tnondef,tsumSTD) 253 c 254 CALL moy_undefSTD(nlevSTD,itap, 255 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 256 $ tnondef,usumSTD) 257 c 258 CALL moy_undefSTD(nlevSTD,itap, 259 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 260 $ tnondef,vsumSTD) 261 c 262 CALL moy_undefSTD(nlevSTD,itap, 263 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 264 $ tnondef,wsumSTD) 265 c 266 CALL moy_undefSTD(nlevSTD,itap, 267 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 268 $ tnondef,phisumSTD) 269 c 270 CALL moy_undefSTD(nlevSTD,itap, 271 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 272 $ tnondef,qsumSTD) 273 c 274 CALL moy_undefSTD(nlevSTD,itap, 275 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 276 $ tnondef,rhsumSTD) 277 c 278 CALL moy_undefSTD(nlevSTD,itap, 279 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 280 $ tnondef,uvsumSTD) 281 c 282 CALL moy_undefSTD(nlevSTD,itap, 283 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 284 $ tnondef,vqsumSTD) 285 c 286 CALL moy_undefSTD(nlevSTD,itap, 287 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 288 $ tnondef,vTsumSTD) 289 c 290 CALL moy_undefSTD(nlevSTD,itap, 291 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 292 $ tnondef,wqsumSTD) 293 c 294 CALL moy_undefSTD(nlevSTD,itap, 295 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 296 $ tnondef,vphisumSTD) 297 c 298 CALL moy_undefSTD(nlevSTD,itap, 299 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 300 $ tnondef,wTsumSTD) 301 c 302 CALL moy_undefSTD(nlevSTD,itap, 303 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 304 $ tnondef,u2sumSTD) 305 c 306 CALL moy_undefSTD(nlevSTD,itap, 307 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 308 $ tnondef,v2sumSTD) 309 c 310 CALL moy_undefSTD(nlevSTD,itap, 311 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 312 $ tnondef,T2sumSTD) 313 c 314 cIM interpolation a chaque pas de temps du SWup(clr) et SWdn(clr) a 200 hPa 127 CALL plevel(klon,klev,.true.,pplay,50000., 128 & zphi/RG,geo500) 129 130 cIM on interpole a chaque pas de temps le SWup(clr) et SWdn(clr) a 200 hPa 315 131 c 316 132 CALL plevel(klon,klevp1,.true.,paprs,20000., -
LMDZ4/trunk/libf/phylmd/clesphys.h
r1279 r1352 43 43 !IM lev_histday : niveau sorties journalieres 44 44 !IM lev_histmth : niveau sorties mensuelles 45 !IM lev_histdayNMC : on peut sortir soit sur 8 (comme AR5) ou bien 46 ! sur 17 niveaux de pression 45 47 INTEGER lev_histhf, lev_histday, lev_histmth 48 INTEGER lev_histdayNMC 46 49 Integer lev_histins, lev_histLES 50 !IM freq_outNMC : frequences de sortie fichiers niveaux de pression (histmthNMC, histdayNMC, histhfNMC) 51 !IM freq_calNMC : frequences de calcul fis. hist*NMC.nc 52 !IM pasphys : pas de temps de physique (secondes) 53 REAL pasphys 54 REAL freq_outNMC(3) , freq_calNMC(3) 47 55 CHARACTER(len=4) type_run 48 56 ! aer_type: pour utiliser un fichier constant dans readaerosol … … 68 76 & , f_cdrag_ter,f_cdrag_oce,f_rugoro & 69 77 & , lev_histhf, lev_histday, lev_histmth & 70 & , lev_histins, lev_histLES & 78 & , lev_histins, lev_histLES, lev_histdayNMC & 79 & , pasphys, freq_outNMC, freq_calNMC & 71 80 & , type_run, ok_isccp, ok_regdyn, ok_cosp & 72 81 & , lonmin_ins, lonmax_ins, latmin_ins, latmax_ins & -
LMDZ4/trunk/libf/phylmd/conf_phys.F90
r1286 r1352 136 136 REAL, SAVE :: fmagic_omp, pmagic_omp 137 137 INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp 138 Integer,save :: lev_histins_omp, lev_histLES_omp 138 Integer, save :: lev_histins_omp, lev_histLES_omp 139 INTEGER, SAVE :: lev_histdayNMC_omp 140 REAL, SAVE :: freq_outNMC_omp(3), freq_calNMC_omp(3) 139 141 CHARACTER*4, SAVE :: type_run_omp 140 142 LOGICAL,SAVE :: ok_isccp_omp … … 1075 1077 lev_histLES_omp = 1 1076 1078 call getin('lev_histLES',lev_histLES_omp) 1077 ! 1079 ! 1080 !Config Key = lev_histdayNMC 1081 !Config Desc = 1082 !Config Def = 8 1083 !Config Help = 1084 ! 1085 lev_histdayNMC_omp = 8 1086 call getin('lev_histdayNMC',lev_histdayNMC_omp) 1087 ! 1088 !histNMC BEG 1089 !Config Key = freq_outNMC 1090 !Config Desc = freq_outNMC(1) = frequence de sortie fichiers histmthNMC 1091 !Config Desc = freq_outNMC(2) = frequence de sortie fichiers histdayNMC 1092 !Config Desc = freq_outNMC(3) = frequence de sortie fichiers histhfNMC 1093 !Config Def = 2592000., 86400., 21600. 1094 !Config Help = 1095 ! 1096 freq_outNMC_omp(1) = 2592000. 1097 freq_outNMC_omp(2) = 86400. 1098 freq_outNMC_omp(3) = 21600. 1099 call getin('freq_outNMC',freq_outNMC_omp) 1100 ! 1101 !Config Key = freq_calNMC 1102 !Config Desc = freq_calNMC(1) = frequence de calcul fichiers histmthNMC 1103 !Config Desc = freq_calNMC(2) = frequence de calcul fichiers histdayNMC 1104 !Config Desc = freq_calNMC(3) = frequence de calcul fichiers histhfNMC 1105 !Config Def = pasphys 1106 !Config Help = 1107 ! 1108 freq_calNMC_omp(1) = pasphys 1109 freq_calNMC_omp(2) = pasphys 1110 freq_calNMC_omp(3) = pasphys 1111 call getin('freq_calNMC',freq_calNMC_omp) 1112 ! 1078 1113 !Config Key = type_run 1079 1114 !Config Desc = … … 1410 1445 lev_histins = lev_histins_omp 1411 1446 lev_histLES = lev_histLES_omp 1447 lev_histdayNMC = lev_histdayNMC_omp 1448 freq_outNMC(:) = freq_outNMC_omp(:) 1449 freq_calNMC(:) = freq_calNMC_omp(:) 1412 1450 1413 1451 type_ocean = type_ocean_omp … … 1591 1629 write(numout,*)' lev_histins = ',lev_histins 1592 1630 write(numout,*)' lev_histLES = ',lev_histLES 1631 write(numout,*)' lev_histdayNMC = ',lev_histdayNMC 1632 write(numout,*)' freq_outNMC = ',freq_outNMC 1633 write(numout,*)' freq_calNMC = ',freq_calNMC 1593 1634 write(numout,*)' iflag_pbl = ', iflag_pbl 1594 1635 write(numout,*)' iflag_thermals = ', iflag_thermals -
LMDZ4/trunk/libf/phylmd/ini_histmthNMC.h
r776 r1352 2 2 ! $Header$ 3 3 ! 4 IF (ok_mensuel) THEN 4 c$OMP MASTER 5 zout = freq_outNMC(1) 5 6 c 6 c$OMP MASTER 7 8 zstophy = dtime 9 zstohf = ecrit_hf 10 zstomth = ecrit_mth 11 zout = ecrit_mth 12 c 13 idayref = day_ref 14 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) 7 idayref = day_ref 8 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) 15 9 c 16 10 cym CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon) … … 25 19 cym CALL histbeg("histNMC.nc", iim,zx_lon(:,1), jjmp1,zx_lat(1,:), 26 20 cym . 1,iim,1,jjmp1, itau_phy, zjulian, dtime, 27 cym . nhori, nid_ nmc)21 cym . nhori, nid_mthnmc) 28 22 29 CALL histbeg_phy("hist NMC",itau_phy, zjulian, dtime,30 . nhori, nid_ nmc)23 CALL histbeg_phy("histmthNMC",itau_phy, zjulian, dtime, 24 . nhori, nid_mthnmc) 31 25 c 32 CALL histvert(nid_ nmc, "presnivs", "Vertical levels", "mb",33 . nlevSTD, rlevSTD /100., nvert)26 CALL histvert(nid_mthnmc, "plev", "pressure", "Pa", 27 . nlevSTD, rlevSTD, nvert) 34 28 ccc 35 29 ccc Champs 3D interpolles sur des niveaux de pression du NMC 36 30 ccc 37 IF(type_run.EQ."ENSP".OR.type_run.EQ."CLIM") THEN38 31 c 39 CALL histdef(nid_nmc, "temp", 40 . "Temperature","K", 32 c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh 33 c sur les niveaux du NMC et on somme & moyenne 34 c toutes les freq_moyNMC secondes par des routines undefSTD et 35 c moy_undefSTD pour eliminer les valeurs "undef" 36 c de la moyenne mensuelle 37 c ======> le "inst(X)" ci-dessous est par consequence factice ! 38 c 39 c 40 CALL histdef(nid_mthnmc, "tnondef", 41 . "Valeurs non-definies","-", 41 42 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 42 43 . "inst(X)", zout,zout) 43 44 c 44 CALL histdef(nid_nmc, "phi",45 . "Geopotential", "m",45 CALL histdef(nid_mthnmc, "ta", 46 . "Air temperature","K", 46 47 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 47 48 . "inst(X)", zout,zout) 48 49 c 49 CALL histdef(nid_nmc, "q",50 . "Specific humidity","kg/kg",50 CALL histdef(nid_mthnmc, "zg", 51 . "Geopotential height", "m", 51 52 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 52 53 . "inst(X)", zout,zout) 53 54 c 54 CALL histdef(nid_nmc, "rh", 55 CALL histdef(nid_mthnmc, "hus", 56 . "Specific humidity","1", 57 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 58 . "inst(X)", zout,zout) 59 c 60 CALL histdef(nid_mthnmc, "hur", 55 61 . "Relative humidity", "%", 56 62 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 57 63 . "inst(X)", zout,zout) 58 64 c 59 CALL histdef(nid_ nmc, "u",60 . " Zonal wind","m/s",65 CALL histdef(nid_mthnmc, "ua", 66 . "Eastward wind","m s-1", 61 67 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 62 68 . "inst(X)", zout,zout) 63 69 c 64 CALL histdef(nid_ nmc, "v",65 . " Meridional wind","m/s",70 CALL histdef(nid_mthnmc, "va", 71 . "Northward wind","m s-1", 66 72 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 67 73 . "inst(X)", zout,zout) 68 74 c 69 ELSE IF(type_run.EQ."AMIP".OR.type_run.EQ."CFMI") THEN 70 c 71 c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh 72 c sur les niveaux du NMC et on somme & moyenne 73 c toutes les 6 heures par des routines undefSTD et 74 c moy_undefSTD pour eliminer les valeurs "undef" 75 c de la moyenne mensuelle 76 c ======> le "inst(X)" ci-dessous est par consequence factice ! 77 c 78 CALL histdef(nid_nmc, "temp", 79 . "Temperature","K", 75 CALL histdef(nid_mthnmc, "wap", 76 . "Lagrangian tendency of air pressure","Pa s-1", 80 77 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 81 78 . "inst(X)", zout,zout) 82 79 c 83 CALL histdef(nid_nmc, "phi", 84 . "Geopotential ", "m", 85 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 86 . "inst(X)", zout,zout) 87 c 88 CALL histdef(nid_nmc, "q", 89 . "Specific humidity","kg/kg", 90 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 91 . "inst(X)", zout,zout) 92 c 93 CALL histdef(nid_nmc, "rh", 94 . "Relative humidity", "%", 95 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 96 . "inst(X)", zout,zout) 97 c 98 CALL histdef(nid_nmc, "u", 99 . "Zonal wind","m/s", 100 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 101 . "inst(X)", zout,zout) 102 c 103 CALL histdef(nid_nmc, "v", 104 . "Meridional wind","m/s", 105 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 106 . "inst(X)", zout,zout) 107 c 108 CALL histdef(nid_nmc, "w", 109 . "Vertical motion","Pa/s", 110 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 111 . "inst(X)", zout,zout) 112 c 113 c ATTENTION : pour AMIP2 on interpole t,u,v,wphi,q,rh 114 c sur les niveaux du NMC et on somme & moyenne 115 c toutes les 6 heures par des routines undefSTD et 116 c moy_undefSTD pour eliminer les valeurs "undef" 117 c de la moyenne mensuelle 118 c ======> le "inst(X)" ci-dessus est par consequence factice ! 119 c 120 c 121 CALL histdef(nid_nmc, "psbg", 80 CALL histdef(nid_mthnmc, "psbg", 122 81 . "Pressure sfce below ground","%", 123 82 . iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 124 83 . "inst(X)", zout,zout) 125 84 c 126 CALL histdef(nid_ nmc, "uv",85 CALL histdef(nid_mthnmc, "uv", 127 86 . "uv ", 128 87 . "m2/s2",iim,jj_nb,nhori, nlevSTD,1,nlevSTD, nvert, 32, 129 88 . "inst(X)", zout,zout) 130 89 c 131 CALL histdef(nid_ nmc, "vq",90 CALL histdef(nid_mthnmc, "vq", 132 91 . "vq ", 133 92 . "m/s * (kg/kg)",iim,jj_nb,nhori, … … 135 94 . "inst(X)", zout,zout) 136 95 c 137 CALL histdef(nid_ nmc, "vT",96 CALL histdef(nid_mthnmc, "vT", 138 97 . "vT ", 139 98 . "mK/s",iim,jj_nb,nhori, … … 141 100 . "inst(X)", zout,zout) 142 101 c 143 CALL histdef(nid_ nmc, "wq",102 CALL histdef(nid_mthnmc, "wq", 144 103 . "wq ", 145 104 . "(Pa/s)*(kg/kg)",iim,jj_nb,nhori, … … 147 106 . "inst(X)", zout,zout) 148 107 c 149 CALL histdef(nid_ nmc, "vphi",108 CALL histdef(nid_mthnmc, "vphi", 150 109 . "vphi ", 151 110 . "m2/s",iim,jj_nb,nhori, … … 153 112 . "inst(X)", zout,zout) 154 113 c 155 CALL histdef(nid_ nmc, "wT",114 CALL histdef(nid_mthnmc, "wT", 156 115 . "wT ", 157 116 . "K*Pa/s",iim,jj_nb,nhori, … … 159 118 . "inst(X)", zout,zout) 160 119 c 161 CALL histdef(nid_ nmc, "uxu",120 CALL histdef(nid_mthnmc, "uxu", 162 121 . "u2 ", 163 122 . "m2/s2",iim,jj_nb,nhori, … … 165 124 . "inst(X)", zout,zout) 166 125 c 167 CALL histdef(nid_ nmc, "vxv",126 CALL histdef(nid_mthnmc, "vxv", 168 127 . "v2 ", 169 128 . "m2/s2",iim,jj_nb,nhori, … … 171 130 . "inst(X)", zout,zout) 172 131 c 173 CALL histdef(nid_ nmc, "TxT",132 CALL histdef(nid_mthnmc, "TxT", 174 133 . "T2 ", 175 134 . "K2",iim,jj_nb,nhori, … … 177 136 . "inst(X)", zout,zout) 178 137 c 179 ENDIF !(type_run.EQ."AMIP")180 138 181 CALL histend(nid_ nmc)139 CALL histend(nid_mthnmc) 182 140 c 183 141 c$OMP END MASTER 184 185 ENDIF ! fin de test sur ok_mensuel -
LMDZ4/trunk/libf/phylmd/ini_undefSTD.F
r776 r1352 3 3 ! 4 4 5 SUBROUTINE ini_undefSTD(nlevSTD,itap, 6 $ dtime,ecrit_day,ecrit_mth, 7 $ tnondef,tsumSTD) 5 SUBROUTINE ini_undefSTD(itap, 6 $ freq_outNMC) 8 7 USE dimphy 8 USE phys_state_var_mod ! Variables sauvegardees de la physique 9 9 IMPLICIT none 10 10 c … … 27 27 c nout=3 !var. mensuelle "NMC" moyennee toutes les 6heures 28 28 c 29 c 30 c NB: mettre "inst(X)" dans le write_histXXX.h ! 29 c NB: mettre "inst(X)" dans le write_hist*NMC.h ! 31 30 c==================================================================== 32 31 c … … 36 35 cym #include "dimphy.h" 37 36 c variables Input/Output 38 39 PARAMETER(klevSTD=17)40 REAL dtime 41 REAL ecrit_day,ecrit_mth 37 c INTEGER nlevSTD, klevSTD, itap 38 INTEGER itap 39 c PARAMETER(klevSTD=17) 40 c REAL dtime 42 41 c 43 42 c variables locales 44 INTEGER i, k, nout 45 PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC 43 c INTEGER i, k, nout, n 44 INTEGER i, k, n 45 c PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC 46 REAL freq_outNMC(nout) 46 47 c 47 48 c variables Output 48 49 49 c REAL tnondef(klon,klevSTD,nout) 50 c REAL tsumSTD(klon,klevSTD,nout) 50 51 c 51 c initialisation variables journalieres en debut de journee 52 DO n=1, nout 52 53 c 53 IF(MOD(itap,NINT(ecrit_day/dtime)).EQ.1.) THEN 54 DO k=1, nlevSTD 55 DO i=1, klon 56 tnondef(i,k,1)=0. 57 tsumSTD(i,k,1)=0. 58 ENDDO !i 59 ENDDO !k 60 ENDIF 54 c initialisation variables en debut de la journee ou du mois 61 55 c 62 c initialisation variables mensuelles (calculees a chaque pas de temps) 63 c en debut de mois : nout=2 56 IF(MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.1.) THEN 64 57 c 65 IF(MOD(itap,NINT(ecrit_mth/dtime)).EQ.1.) THEN 58 c print*,'n freq_ini=',n,itap,freq_outNMC(n)/dtime 66 59 c 67 DO k=1, nlevSTD 68 DO i=1, klon 69 tnondef(i,k,2)=0. 70 tsumSTD(i,k,2)=0. 71 ENDDO !i 72 ENDDO !k 60 DO k=1, nlevSTD 61 DO i=1, klon 62 tnondef(i,k,n)=0. 63 tsumSTD(i,k,n)=0. 64 usumSTD(i,k,n)=0. 65 vsumSTD(i,k,n)=0. 66 wsumSTD(i,k,n)=0. 67 phisumSTD(i,k,n)=0. 68 qsumSTD(i,k,n)=0. 69 rhsumSTD(i,k,n)=0. 70 uvsumSTD(i,k,n)=0. 71 vqsumSTD(i,k,n)=0. 72 vTsumSTD(i,k,n)=0. 73 wqsumSTD(i,k,n)=0. 74 vphisumSTD(i,k,n)=0. 75 wTsumSTD(i,k,n)=0. 76 u2sumSTD(i,k,n)=0. 77 v2sumSTD(i,k,n)=0. 78 T2sumSTD(i,k,n)=0. 79 ENDDO !i 80 ENDDO !k 73 81 c 74 c initialisation variables mensuelles - runs type Amip - (calculees toutes les 6h) 75 c en debut de mois : nout = 3 82 c if(n.EQ.1.AND.i.EQ.4513.AND.k.EQ.17) THEN 83 if(n.EQ.1.AND.i.EQ.1128.AND.k.EQ.17) THEN 84 print*,'itap rlon rlat tlevSTD=',itap,rlon(i),rlat(i), 85 $tlevSTD(i,k) 86 endif 76 87 c 77 DO k=1, nlevSTD 78 DO i=1, klon 79 tnondef(i,k,3)=0. 80 tsumSTD(i,k,3)=0. 81 ENDDO !i 82 ENDDO !k 88 ENDIF !MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.1. 83 89 c 84 END IF90 ENDDO !n 85 91 c 86 92 RETURN -
LMDZ4/trunk/libf/phylmd/moy_undefSTD.F
r1279 r1352 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE moy_undefSTD(nlevSTD,itap, 5 $ dtime,ecrit_day,ecrit_mth,ecrit_hf2mth, 6 $ tnondef,tsumSTD) 4 SUBROUTINE moy_undefSTD(itap,freq_outNMC,freq_moyNMC) 7 5 USE netcdf 8 6 USE dimphy 7 USE phys_state_var_mod ! Variables sauvegardees de la physique 9 8 IMPLICIT none 10 9 c … … 14 13 c 15 14 c Moyenne - a des frequences differentes - des valeurs bien definies 16 c (.NE. 1.E+20) des variables interpolees a un niveau de15 c (.NE.missing_val) des variables interpolees a un niveau de 17 16 c pression. 18 17 c 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees … … 23 22 c 24 23 c 25 c NB: mettre "inst(X)" dans le write_hist XXX.h !24 c NB: mettre "inst(X)" dans le write_hist*NMC.h ! 26 25 c==================================================================== 27 26 cym#include "dimensions.h" … … 32 31 c 33 32 c variables Input 34 35 36 REAL dtime, ecrit_day, ecrit_mth, ecrit_hf2mth33 c INTEGER nlevSTD, klevSTD, itap 34 c PARAMETER(klevSTD=17) 35 INTEGER itap 37 36 c 38 37 c variables locales 39 INTEGER i, k, nout 40 PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC 38 c INTEGER i, k, nout, n 39 c PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC 40 INTEGER i, k, n 41 c REAL dtime, freq_outNMC(nout), freq_moyNMC(nout) 42 REAL freq_outNMC(nout), freq_moyNMC(nout) 41 43 c 42 44 c variables Output 43 44 45 c REAL tnondef(klon,klevSTD,nout) 46 c REAL tsumSTD(klon,klevSTD,nout) 45 47 c 46 48 REAL missing_val … … 48 50 missing_val=nf90_fill_real 49 51 c 52 DO n=1, nout 53 c 50 54 c calcul 1 fois par jour 51 55 c 52 IF(MOD(itap,NINT(ecrit_day/dtime)).EQ.0) THEN 53 DO k=1, nlevSTD 54 DO i=1, klon 55 IF (NINT(tnondef(i,k,1)).NE.NINT(ecrit_day/dtime)) THEN 56 tsumSTD(i,k,1)=tsumSTD(i,k,1)/ 57 $ (ecrit_day/dtime-tnondef(i,k,1)) 58 ELSE 59 tsumSTD(i,k,1)=missing_val 60 ENDIF !tnondef 61 ENDDO !i 62 ENDDO !k 63 ENDIF !MOD(itap,ecrit_day).EQ.0 56 IF(MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0) THEN 64 57 c 65 c calcul 1 fois par mois58 c print*,'n freq_ini=',n,itap,freq_outNMC(n),missing_val 66 59 c 67 IF(MOD(itap,NINT(ecrit_mth/dtime)).EQ.0) THEN 68 DO k=1, nlevSTD 69 DO i=1, klon 70 IF(tnondef(i,k,2).NE.ecrit_mth/dtime) THEN 71 tsumSTD(i,k,2)=tsumSTD(i,k,2)/ 72 $ (ecrit_mth/dtime-tnondef(i,k,2)) 73 ELSE 74 tsumSTD(i,k,2)=missing_val 75 ENDIF !tnondef 60 DO k=1, nlevSTD 61 DO i=1, klon 62 IF(tnondef(i,k,n).NE.(freq_moyNMC(n))) THEN 63 tsumSTD(i,k,n)=tsumSTD(i,k,n)/ 64 $ (freq_moyNMC(n)-tnondef(i,k,n)) 65 cIM BEG 66 usumSTD(i,k,n)=usumSTD(i,k,n)/ 67 $ (freq_moyNMC(n)-tnondef(i,k,n)) 68 vsumSTD(i,k,n)=vsumSTD(i,k,n)/ 69 $ (freq_moyNMC(n)-tnondef(i,k,n)) 70 wsumSTD(i,k,n)=wsumSTD(i,k,n)/ 71 $ (freq_moyNMC(n)-tnondef(i,k,n)) 72 phisumSTD(i,k,n)=phisumSTD(i,k,n)/ 73 $ (freq_moyNMC(n)-tnondef(i,k,n)) 74 qsumSTD(i,k,n)=qsumSTD(i,k,n)/ 75 $ (freq_moyNMC(n)-tnondef(i,k,n)) 76 rhsumSTD(i,k,n)=rhsumSTD(i,k,n)/ 77 $ (freq_moyNMC(n)-tnondef(i,k,n)) 78 uvsumSTD(i,k,n)=uvsumSTD(i,k,n)/ 79 $ (freq_moyNMC(n)-tnondef(i,k,n)) 80 vqsumSTD(i,k,n)=vqsumSTD(i,k,n)/ 81 $ (freq_moyNMC(n)-tnondef(i,k,n)) 82 vTsumSTD(i,k,n)=vTsumSTD(i,k,n)/ 83 $ (freq_moyNMC(n)-tnondef(i,k,n)) 84 wqsumSTD(i,k,n)=wqsumSTD(i,k,n)/ 85 $ (freq_moyNMC(n)-tnondef(i,k,n)) 86 vphisumSTD(i,k,n)=vphisumSTD(i,k,n)/ 87 $ (freq_moyNMC(n)-tnondef(i,k,n)) 88 wTsumSTD(i,k,n)=wTsumSTD(i,k,n)/ 89 $ (freq_moyNMC(n)-tnondef(i,k,n)) 90 u2sumSTD(i,k,n)=u2sumSTD(i,k,n)/ 91 $ (freq_moyNMC(n)-tnondef(i,k,n)) 92 v2sumSTD(i,k,n)=v2sumSTD(i,k,n)/ 93 $ (freq_moyNMC(n)-tnondef(i,k,n)) 94 T2sumSTD(i,k,n)=T2sumSTD(i,k,n)/ 95 $ (freq_moyNMC(n)-tnondef(i,k,n)) 96 cIM END 97 ELSE 98 tsumSTD(i,k,n)=missing_val 99 usumSTD(i,k,n)=missing_val 100 vsumSTD(i,k,n)=missing_val 101 wsumSTD(i,k,n)=missing_val 102 phisumSTD(i,k,n)=missing_val 103 qsumSTD(i,k,n)=missing_val 104 rhsumSTD(i,k,n)=missing_val 105 uvsumSTD(i,k,n)=missing_val 106 vqsumSTD(i,k,n)=missing_val 107 vTsumSTD(i,k,n)=missing_val 108 wqsumSTD(i,k,n)=missing_val 109 vphisumSTD(i,k,n)=missing_val 110 wTsumSTD(i,k,n)=missing_val 111 u2sumSTD(i,k,n)=missing_val 112 v2sumSTD(i,k,n)=missing_val 113 T2sumSTD(i,k,n)=missing_val 114 ENDIF !tnondef(i,k,n).NE.(freq_moyNMC(n)) 76 115 c 77 IF(tnondef(i,k,3).NE.NINT(ecrit_hf2mth)) THEN 78 tsumSTD(i,k,3)=tsumSTD(i,k,3)/ 79 $ (ecrit_hf2mth-tnondef(i,k,3)) 80 ELSE 81 tsumSTD(i,k,3)=missing_val 82 ENDIF !tnondef 116 c if(n.EQ.1.AND.i.EQ.4513.AND.k.EQ.17) THEN 117 if(n.EQ.1.AND.i.EQ.1128.AND.k.EQ.17) THEN 118 print*,'itap rlon rlat tlevSTD=',itap,rlon(i),rlat(i), 119 $tlevSTD(i,k) 120 endif 83 121 c 84 ENDDO !i 85 ENDDO !k 86 ENDIF !MOD 122 ENDDO !i 123 ENDDO !k 124 ENDIF !MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0 125 c 126 ENDDO !n 87 127 c 88 128 RETURN -
LMDZ4/trunk/libf/phylmd/phys_state_var_mod.F90
r1279 r1352 8 8 USE dimphy 9 9 INTEGER, PARAMETER :: nlevSTD=17 10 INTEGER, PARAMETER :: nlevSTD8=8 11 INTEGER, PARAMETER :: nlevSTD3=3 10 12 INTEGER, PARAMETER :: nout=3 11 13 INTEGER, PARAMETER :: napisccp=1 12 14 INTEGER, SAVE :: radpas 15 !$OMP THREADPRIVATE(radpas) 13 16 REAL, SAVE :: dtime, solaire_etat0 14 !$OMP THREADPRIVATE(radpas)15 17 !$OMP THREADPRIVATE(dtime, solaire_etat0) 16 18 … … 115 117 REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:) 116 118 !$OMP THREADPRIVATE(T2sumSTD) 119 !IM begin 120 REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:) 121 REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:) 122 REAL,ALLOCATABLE,SAVE :: philevSTD(:,:) 123 REAL,ALLOCATABLE,SAVE :: uvSTD(:,:) 124 REAL,ALLOCATABLE,SAVE :: vqSTD(:,:) 125 REAL,ALLOCATABLE,SAVE :: vTSTD(:,:) 126 REAL,ALLOCATABLE,SAVE :: wqSTD(:,:) 127 REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:) 128 REAL,ALLOCATABLE,SAVE :: wTSTD(:,:) 129 REAL,ALLOCATABLE,SAVE :: u2STD(:,:) 130 REAL,ALLOCATABLE,SAVE :: v2STD(:,:) 131 REAL,ALLOCATABLE,SAVE :: T2STD(:,:) 132 !IM end 117 133 INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:) 118 134 !$OMP THREADPRIVATE(seed_old) … … 351 367 ALLOCATE(v2sumSTD(klon,nlevSTD,nout)) 352 368 ALLOCATE(T2sumSTD(klon,nlevSTD,nout)) 369 !IM beg 370 ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD)) 371 ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD)) 372 ALLOCATE(philevSTD(klon,nlevSTD)) 373 ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD)) 374 ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD)) 375 ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD)) 376 ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD)) 377 ALLOCATE(T2STD(klon,nlevSTD)) 378 !IM end 353 379 ALLOCATE(seed_old(klon,napisccp)) 354 380 ALLOCATE(zuthe(klon),zvthe(klon)) … … 452 478 deallocate(v2sumSTD) 453 479 deallocate(T2sumSTD) 480 !IM beg 481 deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD) 482 deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD) 483 !IM end 454 484 deallocate(seed_old) 455 485 deallocate(zuthe, zvthe) -
LMDZ4/trunk/libf/phylmd/physiq.F
r1340 r1352 34 34 use regr_pr_av_m, only: regr_pr_av 35 35 use netcdf95, only: nf95_close 36 cIM for NMC files 37 use netcdf, only: nf90_fill_real 36 38 use mod_phys_lmdz_mpi_data, only: is_mpi_root 37 39 USE aero_mod … … 53 55 c CLEFS CPP POUR LES IO 54 56 c ===================== 55 c#define histmthNMC57 #define histNMC 56 58 c#define histISCCP 57 59 c====================================================================== … … 256 258 CHARACTER*4 bb2 257 259 CHARACTER*2 bb3 258 c 259 real tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD) 260 real rhlevSTD(klon,nlevSTD), philevSTD(klon,nlevSTD) 261 real ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD) 262 real wlevSTD(klon,nlevSTD) 263 260 c 264 261 real twriteSTD(klon,nlevSTD,nfiles) 265 262 real qwriteSTD(klon,nlevSTD,nfiles) … … 269 266 real vwriteSTD(klon,nlevSTD,nfiles) 270 267 real wwriteSTD(klon,nlevSTD,nfiles) 268 cIM for NMC files 269 REAL geo500(klon) 270 real :: rlevSTD3(nlevSTD3) 271 DATA rlevSTD3/85000., 50000., 25000./ 272 SAVE rlevSTD3 273 c$OMP THREADPRIVATE(rlevSTD3) 274 real :: rlevSTD8(nlevSTD8) 275 DATA rlevSTD8/100000., 85000., 70000., 50000., 25000., 10000., 276 $ 5000., 1000./ 277 SAVE rlevSTD8 278 c$OMP THREADPRIVATE(rlevSTD8) 279 real twriteSTD3(klon,nlevSTD3) 280 real qwriteSTD3(klon,nlevSTD3) 281 real rhwriteSTD3(klon,nlevSTD3) 282 real phiwriteSTD3(klon,nlevSTD3) 283 real uwriteSTD3(klon,nlevSTD3) 284 real vwriteSTD3(klon,nlevSTD3) 285 real wwriteSTD3(klon,nlevSTD3) 286 c 287 real tnondefSTD8(klon,nlevSTD8) 288 real twriteSTD8(klon,nlevSTD8) 289 real qwriteSTD8(klon,nlevSTD8) 290 real rhwriteSTD8(klon,nlevSTD8) 291 real phiwriteSTD8(klon,nlevSTD8) 292 real uwriteSTD8(klon,nlevSTD8) 293 real vwriteSTD8(klon,nlevSTD8) 294 real wwriteSTD8(klon,nlevSTD8) 295 c 296 c plevSTD3 END 271 297 c 272 298 c nout : niveau de output des variables a une pression donnee … … 276 302 c a partir des valeurs instantannees toutes les 6 h 277 303 c qui sont moyennees sur le mois 278 c279 real uvSTD(klon,nlevSTD)280 real vqSTD(klon,nlevSTD)281 real vTSTD(klon,nlevSTD)282 real wqSTD(klon,nlevSTD)283 c284 real vphiSTD(klon,nlevSTD)285 real wTSTD(klon,nlevSTD)286 real u2STD(klon,nlevSTD)287 real v2STD(klon,nlevSTD)288 real T2STD(klon,nlevSTD)289 304 c 290 305 #include "radopt.h" … … 971 986 REAL zx_tmp_fi2d(klon) ! variable temporaire grille physique 972 987 REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D 973 c#ifdef hist mthNMC988 c#ifdef histNMC 974 989 cym A voir plus tard !!!! 975 990 cym REAL zx_tmp_NC(iim,jjmp1,nlevSTD) … … 979 994 REAL zx_tmp_2d(iim,jjmp1), zx_tmp_3d(iim,jjmp1,klev) 980 995 REAL zx_lon(iim,jjmp1), zx_lat(iim,jjmp1) 981 c 982 INTEGER nid_day, nid_mth, nid_ins, nid_nmc, nid_day_seri 983 INTEGER nid_ctesGCM 984 SAVE nid_day, nid_mth, nid_ins, nid_nmc, nid_day_seri 985 SAVE nid_ctesGCM 986 c$OMP THREADPRIVATE(nid_day, nid_mth, nid_ins, nid_nmc) 996 cIM for NMC files 997 REAL missing_val 998 REAL, SAVE :: freq_moyNMC(nout) 999 c$OMP THREADPRIVATE(freq_moyNMC) 1000 c 1001 INTEGER nid_day, nid_mth, nid_ins, nid_mthnmc, nid_daynmc 1002 INTEGER nid_hfnmc, nid_day_seri, nid_ctesGCM 1003 SAVE nid_day, nid_mth, nid_ins, nid_mthnmc, nid_daynmc 1004 SAVE nid_hfnmc, nid_day_seri, nid_ctesGCM 1005 c$OMP THREADPRIVATE(nid_day, nid_mth, nid_ins) 1006 c$OMP THREADPRIVATE(nid_mthnmc, nid_daynmc, nid_hfnmc) 987 1007 c$OMP THREADPRIVATE(nid_day_seri,nid_ctesGCM) 988 1008 c … … 1107 1127 ! edges of pressure intervals for ozone climatologies, in Pa, in strictly 1108 1128 ! ascending order 1129 cIM for NMC files en parallele 1130 c$OMP THREADPRIVATE(read_climoz, ncid_climoz, press_climoz) 1109 1131 1110 1132 integer, save:: co3i = 0 … … 1130 1152 c============================================================ 1131 1153 real :: mr_ozone(klon,klev) 1154 cIM for NMC files 1155 missing_val=nf90_fill_real 1132 1156 c====================================================================== 1133 1157 ! Ecriture eventuelle d'un profil verticale en entree de la physique. … … 1175 1199 print*, 'Allocation des variables locales et sauvegardees' 1176 1200 call phys_local_var_init 1201 c 1202 pasphys=pdtphys 1177 1203 c appel a la lecture du run.def physique 1178 1204 call conf_phys(ok_journe, ok_mensuel, … … 1192 1218 call phys_output_var_init 1193 1219 print*, '=================================================' 1194 1220 cIM for NMC files 1221 cIM freq_moyNMC = frequences auxquelles on moyenne les champs accumules 1222 cIM sur les niveaux de pression standard du NMC 1223 DO n=1, nout 1224 freq_moyNMC(n)=freq_outNMC(n)/freq_calNMC(n) 1225 ENDDO 1226 c 1195 1227 cIM beg 1196 1228 dnwd0=0.0 … … 1469 1501 #endif 1470 1502 1471 #ifdef histmthNMC 1503 #ifdef histNMC 1504 #include "ini_histhfNMC.h" 1505 #include "ini_histdayNMC.h" 1472 1506 #include "ini_histmthNMC.h" 1473 1507 #endif … … 1483 1517 1484 1518 ecrit_hf = ecrit_hf * un_jour 1485 !IM1519 cIM 1486 1520 IF(ecrit_day.LE.1.) THEN 1487 1521 ecrit_day = ecrit_day * un_jour !en secondes 1488 1522 ENDIF 1489 !IM1523 cIM 1490 1524 ecrit_mth = ecrit_mth * un_jour 1491 1525 ecrit_ins = ecrit_ins * un_jour … … 3331 3365 c 3332 3366 #include "calcul_STDlev.h" 3333 twriteSTD(:,:,1)=tsumSTD(:,:, 2)3334 qwriteSTD(:,:,1)=qsumSTD(:,:, 2)3335 rhwriteSTD(:,:,1)=rhsumSTD(:,:, 2)3336 phiwriteSTD(:,:,1)=phisumSTD(:,:, 2)3337 uwriteSTD(:,:,1)=usumSTD(:,:, 2)3338 vwriteSTD(:,:,1)=vsumSTD(:,:, 2)3339 wwriteSTD(:,:,1)=wsumSTD(:,:, 2)3340 3341 twriteSTD(:,:,2)=tsumSTD(:,:, 1)3342 qwriteSTD(:,:,2)=qsumSTD(:,:, 1)3343 rhwriteSTD(:,:,2)=rhsumSTD(:,:, 1)3344 phiwriteSTD(:,:,2)=phisumSTD(:,:, 1)3345 uwriteSTD(:,:,2)=usumSTD(:,:, 1)3346 vwriteSTD(:,:,2)=vsumSTD(:,:, 1)3347 wwriteSTD(:,:,2)=wsumSTD(:,:, 1)3367 twriteSTD(:,:,1)=tsumSTD(:,:,1) 3368 qwriteSTD(:,:,1)=qsumSTD(:,:,1) 3369 rhwriteSTD(:,:,1)=rhsumSTD(:,:,1) 3370 phiwriteSTD(:,:,1)=phisumSTD(:,:,1) 3371 uwriteSTD(:,:,1)=usumSTD(:,:,1) 3372 vwriteSTD(:,:,1)=vsumSTD(:,:,1) 3373 wwriteSTD(:,:,1)=wsumSTD(:,:,1) 3374 3375 twriteSTD(:,:,2)=tsumSTD(:,:,2) 3376 qwriteSTD(:,:,2)=qsumSTD(:,:,2) 3377 rhwriteSTD(:,:,2)=rhsumSTD(:,:,2) 3378 phiwriteSTD(:,:,2)=phisumSTD(:,:,2) 3379 uwriteSTD(:,:,2)=usumSTD(:,:,2) 3380 vwriteSTD(:,:,2)=vsumSTD(:,:,2) 3381 wwriteSTD(:,:,2)=wsumSTD(:,:,2) 3348 3382 3349 3383 twriteSTD(:,:,3)=tlevSTD(:,:) … … 3362 3396 vwriteSTD(:,:,4)=vlevSTD(:,:) 3363 3397 wwriteSTD(:,:,4)=wlevSTD(:,:) 3398 c 3399 cIM initialisation 5eme fichier de sortie 3400 twriteSTD(:,:,5)=tlevSTD(:,:) 3401 qwriteSTD(:,:,5)=qlevSTD(:,:) 3402 rhwriteSTD(:,:,5)=rhlevSTD(:,:) 3403 phiwriteSTD(:,:,5)=philevSTD(:,:) 3404 uwriteSTD(:,:,5)=ulevSTD(:,:) 3405 vwriteSTD(:,:,5)=vlevSTD(:,:) 3406 wwriteSTD(:,:,5)=wlevSTD(:,:) 3407 cIM for NMC files 3408 DO n=1, nlevSTD3 3409 DO k=1, nlevSTD 3410 if(rlevSTD3(n).EQ.rlevSTD(k)) THEN 3411 twriteSTD3(:,n)=tlevSTD(:,k) 3412 qwriteSTD3(:,n)=qlevSTD(:,k) 3413 rhwriteSTD3(:,n)=rhlevSTD(:,k) 3414 phiwriteSTD3(:,n)=philevSTD(:,k) 3415 uwriteSTD3(:,n)=ulevSTD(:,k) 3416 vwriteSTD3(:,n)=vlevSTD(:,k) 3417 wwriteSTD3(:,n)=wlevSTD(:,k) 3418 endif !rlevSTD3(n).EQ.rlevSTD(k) 3419 ENDDO 3420 ENDDO 3421 c 3422 DO n=1, nlevSTD8 3423 DO k=1, nlevSTD 3424 if(rlevSTD8(n).EQ.rlevSTD(k)) THEN 3425 tnondefSTD8(:,n)=tnondef(:,k,2) 3426 twriteSTD8(:,n)=tsumSTD(:,k,2) 3427 qwriteSTD8(:,n)=qsumSTD(:,k,2) 3428 rhwriteSTD8(:,n)=rhsumSTD(:,k,2) 3429 phiwriteSTD8(:,n)=phisumSTD(:,k,2) 3430 uwriteSTD8(:,n)=usumSTD(:,k,2) 3431 vwriteSTD8(:,n)=vsumSTD(:,k,2) 3432 wwriteSTD8(:,n)=wsumSTD(:,k,2) 3433 endif !rlevSTD8(n).EQ.rlevSTD(k) 3434 ENDDO 3435 ENDDO 3364 3436 c 3365 3437 c slp sea level pressure … … 3521 3593 #endif 3522 3594 3523 #ifdef histmthNMC 3595 #ifdef histNMC 3596 #include "write_histhfNMC.h" 3597 #include "write_histdayNMC.h" 3524 3598 #include "write_histmthNMC.h" 3525 3599 #endif -
LMDZ4/trunk/libf/phylmd/undefSTD.F
r1279 r1352 2 2 ! $Header$ 3 3 ! 4 SUBROUTINE undefSTD(nlevSTD,itap,tlevSTD, 5 $ dtime,ecrit_hf, 6 $ oknondef,tnondef,tsumSTD) 4 SUBROUTINE undefSTD(itap,freq_calNMC) 7 5 USE netcdf 8 6 USE dimphy 7 USE phys_state_var_mod ! Variables sauvegardees de la physique 9 8 IMPLICIT none 10 9 c … … 14 13 c 15 14 c Calcul * du nombre de pas de temps (FLOAT(ecrit_XXX)-tnondef)) 16 c ou la variable tlevSTD est bien definie (.NE. 1.E+20),15 c ou la variable tlevSTD est bien definie (.NE.missing_val), 17 16 c et 18 17 c * de la somme de tlevSTD => tsumSTD … … 22 21 c nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps 23 22 c ! de la physique 24 c nout=3 !var. mensuelle "NMC" moyennee toutes les 6heures23 c nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf 25 24 c 26 25 c 27 c NB: mettre "inst(X)" dans le write_hist XXX.h !26 c NB: mettre "inst(X)" dans le write_hist*NMC.h ! 28 27 c==================================================================== 29 28 c … … 34 33 c variables Input 35 34 c 36 INTEGER nlevSTD, klevSTD, itap 37 PARAMETER(klevSTD=17) 38 REAL dtime, ecrit_hf 35 c INTEGER nlevSTD, klevSTD, itap 36 c PARAMETER(klevSTD=17) 37 INTEGER itap 38 c REAL dtime 39 39 c 40 40 c variables locales 41 INTEGER i, k, nout 42 PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC 41 c INTEGER i, k, nout, n 42 c PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC 43 INTEGER i, k, n 44 REAL freq_calNMC(nout) 43 45 c 44 46 c variables Output 45 46 47 47 c REAL tlevSTD(klon,klevSTD), tsumSTD(klon,klevSTD,nout) 48 c LOGICAL oknondef(klon,klevSTD,nout) 49 c REAL tnondef(klon,klevSTD,nout) 48 50 c 49 51 REAL missing_val … … 51 53 missing_val=nf90_fill_real 52 54 c 53 c calcul variables tous les pas de temps de la physique 55 DO n=1, nout 54 56 c 55 DO k=1, nlevSTD56 DO i=1, klon57 IF(tlevSTD(i,k).EQ.missing_val) THEN58 IF(oknondef(i,k,1)) THEN59 tnondef(i,k,1)=tnondef(i,k,1)+1.60 ENDIF !oknondef(i,k)61 57 c 62 IF(oknondef(i,k,2)) THEN 63 tnondef(i,k,2)=tnondef(i,k,2)+1. 64 ENDIF !oknondef(i,k) 58 c calcul variables tous les freq_calNMC(n)/dtime pas de temps 59 c de la physique 65 60 c 66 ELSE IF(tlevSTD(i,k).NE.missing_val) THEN 67 tsumSTD(i,k,1)=tsumSTD(i,k,1)+tlevSTD(i,k) 68 tsumSTD(i,k,2)=tsumSTD(i,k,2)+tlevSTD(i,k) 69 ENDIF 70 ENDDO !i 71 ENDDO !k 61 IF(MOD(itap,NINT(freq_calNMC(n)/dtime)).EQ.0) THEN 72 62 c 73 c calcul variables toutes les 6h63 c print*,'n freq_cal=',n,itap,freq_calNMC(n)/dtime 74 64 c 75 IF(MOD(itap,NINT(ecrit_hf/dtime)).EQ.0) THEN 65 DO k=1, nlevSTD 66 DO i=1, klon 67 IF(tlevSTD(i,k).EQ.missing_val) THEN 68 c IF(oknondef(i,k,n)) THEN 69 tnondef(i,k,n)=tnondef(i,k,n)+1. 70 c ENDIF !oknondef(i,k) 76 71 c 77 DO k=1, nlevSTD 78 DO i=1, klon 79 IF(tlevSTD(i,k).EQ.missing_val) THEN 80 IF(oknondef(i,k,3)) THEN 81 tnondef(i,k,3)=tnondef(i,k,3)+1. 82 ENDIF !oknondef(i,k) 72 ELSE IF(tlevSTD(i,k).NE.missing_val) THEN 73 tsumSTD(i,k,n)=tsumSTD(i,k,n)+tlevSTD(i,k) 74 usumSTD(i,k,n)=usumSTD(i,k,n)+ulevSTD(i,k) 75 vsumSTD(i,k,n)=vsumSTD(i,k,n)+vlevSTD(i,k) 76 wsumSTD(i,k,n)=wsumSTD(i,k,n)+wlevSTD(i,k) 77 phisumSTD(i,k,n)=phisumSTD(i,k,n)+philevSTD(i,k) 78 qsumSTD(i,k,n)=qsumSTD(i,k,n)+qlevSTD(i,k) 79 rhsumSTD(i,k,n)=rhsumSTD(i,k,n)+rhlevSTD(i,k) 80 uvsumSTD(i,k,n)=uvsumSTD(i,k,n)+uvSTD(i,k) 81 vqsumSTD(i,k,n)=vqsumSTD(i,k,n)+vqSTD(i,k) 82 vTsumSTD(i,k,n)=vTsumSTD(i,k,n)+vTSTD(i,k) 83 wqsumSTD(i,k,n)=wqsumSTD(i,k,n)+wqSTD(i,k) 84 vphisumSTD(i,k,n)=vphisumSTD(i,k,n)+vphiSTD(i,k) 85 wTsumSTD(i,k,n)=wTsumSTD(i,k,n)+wTSTD(i,k) 86 u2sumSTD(i,k,n)=u2sumSTD(i,k,n)+u2STD(i,k) 87 v2sumSTD(i,k,n)=v2sumSTD(i,k,n)+v2STD(i,k) 88 T2sumSTD(i,k,n)=T2sumSTD(i,k,n)+T2STD(i,k) 83 89 c 84 ELSE IF(tlevSTD(i,k).NE.missing_val) THEN 85 tsumSTD(i,k,3)=tsumSTD(i,k,3)+tlevSTD(i,k) 86 ENDIF 87 ENDDO !i 88 ENDDO !k 89 90 ENDIF !MOD(itap,NINT(ecrit_hf/dtime)).EQ.0 90 c if(n.EQ.1.AND.i.EQ.4513.AND.k.EQ.17) THEN 91 if(n.EQ.1.AND.i.EQ.1128.AND.k.EQ.17) THEN 92 print*,'itap rlon rlat tlevSTD=',itap,rlon(i),rlat(i), 93 $tlevSTD(i,k) 94 endif 95 c 96 ENDIF 97 ENDDO !i 98 ENDDO !k 99 c 100 ENDIF !MOD(itap,NINT(freq_calNMC(n)/dtime)).EQ.0 101 c 102 ENDDO !n 91 103 c 92 104 RETURN -
LMDZ4/trunk/libf/phylmd/write_histmthNMC.h
r776 r1352 2 2 ! $Header$ 3 3 ! 4 IF (ok_mensuel) THEN5 4 c 6 5 ndex3d = 0 … … 9 8 c Champs interpolles sur des niveaux de pression du NMC 10 9 c 11 c PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC 10 c PARAMETER(nout=3) 11 c nout=1 : in=pdtphys, out=mth 12 c nout=2 : in=pdtphys, out=day 13 c nout=3 : in=pdtphys, out=hf 12 14 ccc 13 IF(type_run.EQ."CLIM".OR.type_run.EQ."ENSP") THEN 14 ccc 15 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,tsumSTD(:,:,2), 16 cym $ zx_tmp_NC) 17 CALL histwrite_phy(nid_nmc,"temp",itau_w,tsumSTD(:,:,2)) 15 CALL histwrite_phy(nid_mthnmc,"tnondef",itau_w,tnondef(:,:,1)) 18 16 c 19 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,phisumSTD(:,:,2), 20 cym $ zx_tmp_NC) 21 CALL histwrite_phy(nid_nmc,"phi",itau_w,phisumSTD(:,:,2)) 17 c CALL histwrite_phy(nid_mthnmc,"ta",itau_w,twriteSTD(:,:,1)) 18 CALL histwrite_phy(nid_mthnmc,"ta",itau_w,tsumSTD(:,:,1)) 22 19 c 23 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,qsumSTD(:,:,2), 24 cym $ zx_tmp_NC) 25 CALL histwrite_phy(nid_nmc,"q",itau_w,qsumSTD(:,:,2)) 20 CALL histwrite_phy(nid_mthnmc,"zg",itau_w,phiwriteSTD(:,:,1)) 26 21 c 27 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,rhsumSTD(:,:,2), 28 cym $ zx_tmp_NC) 29 CALL histwrite_phy(nid_nmc,"rh",itau_w,rhsumSTD(:,:,2)) 22 CALL histwrite_phy(nid_mthnmc,"hus",itau_w,qwriteSTD(:,:,1)) 30 23 c 31 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,usumSTD(:,:,2), 32 cym $ zx_tmp_NC) 33 CALL histwrite_phy(nid_nmc,"u",itau_w,usumSTD(:,:,2)) 24 CALL histwrite_phy(nid_mthnmc,"hur",itau_w,rhwriteSTD(:,:,1)) 34 25 c 35 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,vsumSTD(:,:,2), 36 cym $ zx_tmp_NC) 37 CALL histwrite_phy(nid_nmc,"v",itau_w,vsumSTD(:,:,2)) 38 ccc 39 ELSE IF(type_run.EQ."AMIP".OR.type_run.EQ."CFMI") THEN 40 ccc 41 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,tsumSTD(:,:,3), 42 cym $ zx_tmp_NC) 43 CALL histwrite_phy(nid_nmc,"temp",itau_w,tsumSTD(:,:,3)) 26 CALL histwrite_phy(nid_mthnmc,"ua",itau_w,uwriteSTD(:,:,1)) 44 27 c 45 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,phisumSTD(:,:,3), 46 cym $ zx_tmp_NC) 47 CALL histwrite_phy(nid_nmc,"phi",itau_w,phisumSTD(:,:,3)) 28 CALL histwrite_phy(nid_mthnmc,"va",itau_w,vwriteSTD(:,:,1)) 48 29 c 49 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,qsumSTD(:,:,3), 50 cym $ zx_tmp_NC) 51 CALL histwrite_phy(nid_nmc,"q",itau_w,qsumSTD(:,:,3)) 52 c 53 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,rhsumSTD(:,:,3), 54 cym $ zx_tmp_NC) 55 CALL histwrite_phy(nid_nmc,"rh",itau_w,rhsumSTD(:,:,3)) 56 c 57 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,usumSTD(:,:,3), 58 cym $ zx_tmp_NC) 59 CALL histwrite_phy(nid_nmc,"u",itau_w,usumSTD(:,:,3)) 60 c 61 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,vsumSTD(:,:,3), 62 cym $ zx_tmp_NC) 63 CALL histwrite_phy(nid_nmc,"v",itau_w,vsumSTD(:,:,3)) 64 c 65 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,wsumSTD(:,:,3), 66 cym $ zx_tmp_NC) 67 CALL histwrite_phy(nid_nmc,"w",itau_w,wsumSTD(:,:,3)) 30 CALL histwrite_phy(nid_mthnmc,"wap",itau_w,wwriteSTD(:,:,1)) 68 31 c 69 32 DO k=1, nlevSTD 70 33 DO i=1, klon 71 IF(tnondef(i,k, 3).NE.1.E+20) THEN72 zx_tmp_fiNC(i,k) = (100.*tnondef(i,k, 3))/ecrit_hf2mth34 IF(tnondef(i,k,1).NE.missing_val) THEN 35 zx_tmp_fiNC(i,k) = (100.*tnondef(i,k,1))/ecrit_hf2mth 73 36 ELSE 74 zx_tmp_fiNC(i,k) = 1.E+2037 zx_tmp_fiNC(i,k) = missing_val 75 38 ENDIF 76 39 ENDDO 77 40 ENDDO !k=1, nlevSTD 78 41 c 79 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,zx_tmp_fiNC,zx_tmp_NC) 80 CALL histwrite_phy(nid_nmc,"psbg",itau_w,zx_tmp_fiNC) 42 CALL histwrite_phy(nid_mthnmc,"psbg",itau_w,zx_tmp_fiNC) 81 43 c 82 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,uvsumSTD(:,:,3), 83 cym $ zx_tmp_NC) 84 CALL histwrite_phy(nid_nmc,"uv",itau_w,uvsumSTD(:,:,3)) 44 CALL histwrite_phy(nid_mthnmc,"uv",itau_w,uvsumSTD(:,:,1)) 85 45 c 86 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,vqsumSTD(:,:,3), 87 cym $ zx_tmp_NC) 88 CALL histwrite_phy(nid_nmc,"vq",itau_w,vqsumSTD(:,:,3)) 46 CALL histwrite_phy(nid_mthnmc,"vq",itau_w,vqsumSTD(:,:,1)) 89 47 c 90 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,vTsumSTD(:,:,3), 91 cym $ zx_tmp_NC) 92 CALL histwrite_phy(nid_nmc,"vT",itau_w,vTsumSTD(:,:,3)) 48 CALL histwrite_phy(nid_mthnmc,"vT",itau_w,vTsumSTD(:,:,1)) 93 49 c 94 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1, wqsumSTD(:,:,3), 95 cym $ zx_tmp_NC) 96 CALL histwrite_phy(nid_nmc,"wq",itau_w,wqsumSTD(:,:,3)) 50 CALL histwrite_phy(nid_mthnmc,"wq",itau_w,wqsumSTD(:,:,1)) 97 51 c 98 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,vphisumSTD(:,:,3), 99 cym $ zx_tmp_NC) 100 CALL histwrite_phy(nid_nmc,"vphi",itau_w,vphisumSTD(:,:,3)) 52 CALL histwrite_phy(nid_mthnmc,"vphi",itau_w,vphisumSTD(:,:,1)) 101 53 c 102 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,wTsumSTD(:,:,3), 103 cym $ zx_tmp_NC) 104 CALL histwrite_phy(nid_nmc,"wT",itau_w,wTsumSTD(:,:,3)) 54 CALL histwrite_phy(nid_mthnmc,"wT",itau_w,wTsumSTD(:,:,1)) 105 55 c 106 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,u2sumSTD(:,:,3), 107 cym $ zx_tmp_NC) 108 CALL histwrite_phy(nid_nmc,"uxu",itau_w,u2sumSTD(:,:,3)) 56 CALL histwrite_phy(nid_mthnmc,"uxu",itau_w,u2sumSTD(:,:,1)) 109 57 c 110 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,v2sumSTD(:,:,3), 111 cym $ zx_tmp_NC) 112 CALL histwrite_phy(nid_nmc,"vxv",itau_w,v2sumSTD(:,:,3)) 58 CALL histwrite_phy(nid_mthnmc,"vxv",itau_w,v2sumSTD(:,:,1)) 113 59 c 114 cym CALL gr_fi_ecrit(nlevSTD, klon,iim,jjmp1,T2sumSTD(:,:,3), 115 cym $ zx_tmp_NC) 116 CALL histwrite_phy(nid_nmc,"TxT",itau_w,T2sumSTD(:,:,3)) 117 c 118 ENDIF !type_run 60 CALL histwrite_phy(nid_mthnmc,"TxT",itau_w,T2sumSTD(:,:,1)) 119 61 c 120 62 if (ok_sync) then 121 63 c$OMP MASTER 122 call histsync(nid_ nmc)64 call histsync(nid_mthnmc) 123 65 c$OMP END MASTER 124 66 endif 125 126 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.