Changeset 2573
- Timestamp:
- Oct 25, 2021, 11:01:18 AM (3 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r2571 r2573 3493 3493 == 22/10/2021 == SF+AB 3494 3494 Clarify the description of extract 3495 3496 == 25/10/2021 == MW+EM 3497 Fixes for the picky gfortran10 compiler which identifies using a scalar 3498 instead of a one-element array as an error. -
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/ini_archive.F
r1422 r2573 176 176 ierr = NF_REDEF (nid) 177 177 #ifdef NC_DOUBLE 178 ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1, idim_index,nvarid)179 #else 180 ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1, idim_index,nvarid)178 ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1,[idim_index],nvarid) 179 #else 180 ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1,[idim_index],nvarid) 181 181 #endif 182 182 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, … … 195 195 ierr = NF_REDEF (nid) 196 196 #ifdef NC_DOUBLE 197 ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1, idim_rlonu,nvarid)198 #else 199 ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1, idim_rlonu,nvarid)197 ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1,[idim_rlonu],nvarid) 198 #else 199 ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1,[idim_rlonu],nvarid) 200 200 #endif 201 201 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, … … 210 210 ierr = NF_REDEF (nid) 211 211 #ifdef NC_DOUBLE 212 ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1, idim_rlatu,nvarid)213 #else 214 ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1, idim_rlatu,nvarid)212 ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1,[idim_rlatu],nvarid) 213 #else 214 ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1,[idim_rlatu],nvarid) 215 215 #endif 216 216 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, … … 225 225 ierr = NF_REDEF (nid) 226 226 #ifdef NC_DOUBLE 227 ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1, idim_rlonv,nvarid)228 #else 229 ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1, idim_rlonv,nvarid)227 ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1,[idim_rlonv],nvarid) 228 #else 229 ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1,[idim_rlonv],nvarid) 230 230 #endif 231 231 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, … … 240 240 ierr = NF_REDEF (nid) 241 241 #ifdef NC_DOUBLE 242 ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1, idim_rlatv,nvarid)243 #else 244 ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1, idim_rlatv,nvarid)242 ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1,[idim_rlatv],nvarid) 243 #else 244 ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1,[idim_rlatv],nvarid) 245 245 #endif 246 246 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, … … 260 260 ierr = NF_REDEF (nid) 261 261 #ifdef NC_DOUBLE 262 ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1, idim_llmp1,nvarid)263 #else 264 ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1, idim_llmp1,nvarid)262 ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1,[idim_llmp1],nvarid) 263 #else 264 ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1,[idim_llmp1],nvarid) 265 265 #endif 266 266 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, … … 275 275 ierr = NF_REDEF (nid) 276 276 #ifdef NC_DOUBLE 277 ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1, idim_llmp1,nvarid)278 #else 279 ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1, idim_llmp1,nvarid)277 ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1,[idim_llmp1],nvarid) 278 #else 279 ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1,[idim_llmp1],nvarid) 280 280 #endif 281 281 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 35, … … 291 291 ierr = NF_REDEF (nid) 292 292 #ifdef NC_DOUBLE 293 ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1, idim_llm,nvarid)294 #else 295 ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1, idim_llm,nvarid)293 ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,[idim_llm],nvarid) 294 #else 295 ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,[idim_llm],nvarid) 296 296 #endif 297 297 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 36, … … 307 307 ierr = NF_REDEF (nid) 308 308 #ifdef NC_DOUBLE 309 ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1, idim_llm,nvarid)310 #else 311 ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1, idim_llm,nvarid)309 ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,[idim_llm],nvarid) 310 #else 311 ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,[idim_llm],nvarid) 312 312 #endif 313 313 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 30, … … 324 324 ierr = NF_REDEF (nid) 325 325 #ifdef NC_DOUBLE 326 ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1, idim_llm,nvarid)327 #else 328 ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1, idim_llm,nvarid)326 ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1,[idim_llm],nvarid) 327 #else 328 ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1,[idim_llm],nvarid) 329 329 #endif 330 330 ierr = NF_ENDDEF(nid) … … 339 339 ierr = NF_REDEF (nid) 340 340 #ifdef NC_DOUBLE 341 ierr = NF_DEF_VAR (nid,"latitude",NF_DOUBLE,1, idim_rlatu,nvarid)342 #else 343 ierr = NF_DEF_VAR (nid,"latitude",NF_FLOAT,1, idim_rlatu,nvarid)341 ierr = NF_DEF_VAR (nid,"latitude",NF_DOUBLE,1,[idim_rlatu],nvarid) 342 #else 343 ierr = NF_DEF_VAR (nid,"latitude",NF_FLOAT,1,[idim_rlatu],nvarid) 344 344 #endif 345 345 ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") … … 355 355 ierr = NF_REDEF (nid) 356 356 #ifdef NC_DOUBLE 357 ierr =NF_DEF_VAR(nid,"longitude", NF_DOUBLE, 1, idim_rlonv,nvarid)358 #else 359 ierr = NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, idim_rlonv,nvarid)357 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,[idim_rlonv],nvarid) 358 #else 359 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,[idim_rlonv],nvarid) 360 360 #endif 361 361 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, … … 372 372 #ifdef NC_DOUBLE 373 373 ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, 374 . idim_llm,nvarid)374 . [idim_llm],nvarid) 375 375 #else 376 376 ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, 377 . idim_llm,nvarid)377 . [idim_llm],nvarid) 378 378 #endif 379 379 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",10,"pseudo-alt") … … 394 394 ! define variable 395 395 #ifdef NC_DOUBLE 396 ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1, idim_nsoilmx,nvarid)397 #else 398 ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1, idim_nsoilmx,nvarid)396 ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1,[idim_nsoilmx],nvarid) 397 #else 398 ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1,[idim_nsoilmx],nvarid) 399 399 #endif 400 400 ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, -
trunk/LMDZ.MARS/libf/phymars/iniwrite.F
r2545 r2573 130 130 #ifdef NC_DOUBLE 131 131 ierr = NF_DEF_VAR (nid, "controle", NF_DOUBLE, 1, 132 . idim_index,nvarid)132 . [idim_index],nvarid) 133 133 #else 134 134 ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, 135 . idim_index,nvarid)135 . [idim_index],nvarid) 136 136 #endif 137 137 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 18, … … 165 165 ierr = NF_REDEF (nid) 166 166 #ifdef NC_DOUBLE 167 ierr =NF_DEF_VAR(nid, "latitude", NF_DOUBLE, 1, idim_rlatu,nvarid)168 #else 169 ierr =NF_DEF_VAR (nid, "latitude", NF_FLOAT, 1, idim_rlatu,nvarid)167 ierr=NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,[idim_rlatu],nvarid) 168 #else 169 ierr=NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,[idim_rlatu],nvarid) 170 170 #endif 171 171 ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") … … 190 190 ierr = NF_REDEF (nid) 191 191 #ifdef NC_DOUBLE 192 ierr =NF_DEF_VAR(nid,"longitude", NF_DOUBLE, 1, idim_rlonv,nvarid)193 #else 194 ierr = NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, idim_rlonv,nvarid)192 ierr =NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,[idim_rlonv],nvarid) 193 #else 194 ierr = NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,[idim_rlonv],nvarid) 195 195 #endif 196 196 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, … … 208 208 #ifdef NC_DOUBLE 209 209 ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, 210 . idim_llm,nvarid)210 . [idim_llm],nvarid) 211 211 #else 212 212 ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, 213 . idim_llm,nvarid)213 . [idim_llm],nvarid) 214 214 #endif 215 215 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",10,"pseudo-alt") … … 227 227 ! ierr = NF_REDEF (nid) 228 228 !#ifdef NC_DOUBLE 229 ! ierr = NF_DEF_VAR (nid, "rlatv", NF_DOUBLE, 1, idim_rlatv,nvarid)230 !#else 231 ! ierr = NF_DEF_VAR (nid, "rlatv", NF_FLOAT, 1, idim_rlatv,nvarid)229 ! ierr = NF_DEF_VAR (nid, "rlatv",NF_DOUBLE,1,[idim_rlatv],nvarid) 230 !#else 231 ! ierr = NF_DEF_VAR (nid, "rlatv",NF_FLOAT,1,[idim_rlatv],nvarid) 232 232 !#endif 233 233 ! ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 20, … … 280 280 ! define variable 281 281 #ifdef NC_DOUBLE 282 ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1, idim_nsoilmx,nvarid)283 #else 284 ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1, idim_nsoilmx,nvarid)282 ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1,[idim_nsoilmx],nvarid) 283 #else 284 ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1,[idim_nsoilmx],nvarid) 285 285 #endif 286 286 ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, -
trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90
r1532 r2573 81 81 ! Define the variable 82 82 #ifdef NC_DOUBLE 83 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1, idim_rlonv,varid)84 #else 85 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1, idim_rlonv,varid)83 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,[idim_rlonv],varid) 84 #else 85 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,[idim_rlonv],varid) 86 86 #endif 87 87 if (ierr.ne.NF_NOERR) then … … 119 119 ! Define the variable 120 120 #ifdef NC_DOUBLE 121 ierr=NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1, idim_rlatu,varid)122 #else 123 ierr=NF_DEF_VAR(nid,"latitude",NF_FLOAT,1, idim_rlatu,varid)121 ierr=NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,[idim_rlatu],varid) 122 #else 123 ierr=NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,[idim_rlatu],varid) 124 124 #endif 125 125 if (ierr.ne.NF_NOERR) then … … 150 150 ! Define the variable 151 151 #ifdef NC_DOUBLE 152 ierr=NF_DEF_VAR(nid,"depth",NF_DOUBLE,1, idim_depth,varid)153 #else 154 ierr=NF_DEF_VAR(nid,"depth",NF_FLOAT,1, idim_depth,varid)152 ierr=NF_DEF_VAR(nid,"depth",NF_DOUBLE,1,[idim_depth],varid) 153 #else 154 ierr=NF_DEF_VAR(nid,"depth",NF_FLOAT,1,[idim_depth],varid) 155 155 #endif 156 156 if (ierr.ne.NF_NOERR) then … … 184 184 ! Define the variable 185 185 #ifdef NC_DOUBLE 186 ierr=NF_DEF_VAR(nid,"time",NF_DOUBLE,1, idim_time,varid)187 #else 188 ierr=NF_DEF_VAR(nid,"time",NF_FLOAT,1, idim_time,varid)186 ierr=NF_DEF_VAR(nid,"time",NF_DOUBLE,1,[idim_time],varid) 187 #else 188 ierr=NF_DEF_VAR(nid,"time",NF_FLOAT,1,[idim_time],varid) 189 189 #endif 190 190 if (ierr.ne.NF_NOERR) then -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r2570 r2573 2949 2949 & fluxtop_sw_tot) 2950 2950 call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt) 2951 call WRITEDIAGFI(ngrid,"Sols","Time","sols",0, zday)2951 call WRITEDIAGFI(ngrid,"Sols","Time","sols",0,[zday]) 2952 2952 call WRITEDIAGFI(ngrid,"Ls","Solar longitude","deg", 2953 & 0, zls*180./pi)2953 & 0,[zls*180./pi]) 2954 2954 call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu) 2955 2955 call WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv) … … 3432 3432 3433 3433 call WRITEDIAGFI(ngrid,"PhiH","H escape flux","s-1", 3434 $ 0, PhiEscH)3434 $ 0,[PhiEscH]) 3435 3435 call WRITEDIAGFI(ngrid,"PhiH2","H2 escape flux","s-1", 3436 $ 0, PhiEscH2)3436 $ 0,[PhiEscH2]) 3437 3437 call WRITEDIAGFI(ngrid,"PhiD","D escape flux","s-1", 3438 $ 0, PhiEscD)3438 $ 0,[PhiEscD]) 3439 3439 3440 3440 ! call wstats(ngrid,"PhiH","H escape flux","s-1", 3441 ! $ 0, PhiEscH)3441 ! $ 0,[PhiEscH]) 3442 3442 ! call wstats(ngrid,"PhiH2","H2 escape flux","s-1", 3443 ! $ 0, PhiEscH2)3443 ! $ 0,[PhiEscH2]) 3444 3444 ! call wstats(ngrid,"PhiD","D escape flux","s-1", 3445 ! $ 0, PhiEscD)3445 ! $ 0,[PhiEscD]) 3446 3446 3447 3447 ! call wstats(ngrid,"q15um","15 um cooling","K/s", … … 3907 3907 call WRITEDIAGFI(ngrid,'co2conservation', 3908 3908 & 'Total CO2 mass conservation in physic', 3909 & '%',0, (co2totA-co2totB)/co2totA)3909 & '%',0,[(co2totA-co2totB)/co2totA]) 3910 3910 endif ! of if (igcm_co2_ice.ne.0) 3911 3911 ! XIOS outputs -
trunk/LMDZ.MARS/libf/phymars/writediagfi.F
r2514 r2573 292 292 ! Write (append) the new date to the 'Time' array 293 293 !#ifdef NC_DOUBLE 294 ! ierr= NF_PUT_VARA_DOUBLE(nid,varid, ntime,1,date)294 ! ierr= NF_PUT_VARA_DOUBLE(nid,varid,[ntime],[1],[date]) 295 295 !#else 296 ierr= NF_PUT_VARA_REAL(nid,varid, ntime,1,date)296 ierr= NF_PUT_VARA_REAL(nid,varid,[ntime],[1],[date]) 297 297 !#endif 298 298 if (ierr.ne.NF_NOERR) then … … 496 496 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx2) 497 497 ELSE 498 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges, dx2_1d)498 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,[dx2_1d]) 499 499 ENDIF 500 500 !#endif … … 603 603 604 604 !#ifdef NC_DOUBLE 605 ! ierr = NF_PUT_VARA_DOUBLE (nid,varid, corner,edges,dx0)605 ! ierr = NF_PUT_VARA_DOUBLE (nid,varid,[corner(1)],[edges(1)],[dx0]) 606 606 !#else 607 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx0) 607 ierr= NF_PUT_VARA_REAL(nid,varid,[corner(1)], 608 & [edges(1)],[dx0]) 608 609 !#endif 609 610 if (ierr.ne.NF_NOERR) then -
trunk/LMDZ.MARS/libf/phymars/writediagmicrofi.F
r2437 r2573 308 308 ! ierr= NF_PUT_VARA_DOUBLE(nid,varid,ntime,1,date) 309 309 !#else 310 ierr= NF_PUT_VARA_REAL(nid,varid, ntime,1,date)310 ierr= NF_PUT_VARA_REAL(nid,varid,[ntime],[1],[date]) 311 311 !#endif 312 312 if (ierr.ne.NF_NOERR) then … … 331 331 ierr= NF_INQ_VARID(nid,"microtime",varid) 332 332 !#else 333 ierr= NF_PUT_VARA_REAL(nid,varid, microstep,1,subdate)333 ierr= NF_PUT_VARA_REAL(nid,varid,[microstep],[1],[subdate]) 334 334 !#endif 335 335 if (ierr.ne.NF_NOERR) then … … 539 539 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx2) 540 540 ELSE 541 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges, dx2_1d)541 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,[dx2_1d]) 542 542 ENDIF 543 543 !#endif … … 654 654 ! ierr = NF_PUT_VARA_DOUBLE (nid,varid,corner,edges,dx0) 655 655 !#else 656 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges, dx0)656 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,[dx0]) 657 657 !#endif 658 658 if (ierr.ne.NF_NOERR) then -
trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
r2311 r2573 174 174 ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,ntime,1,date) 175 175 !#else 176 ierr=NF_PUT_VARA_REAL(nid,varid, ntime,1,date)176 ierr=NF_PUT_VARA_REAL(nid,varid,[ntime],[1],[date]) 177 177 !#endif 178 178 if (ierr.ne.NF_NOERR) then … … 342 342 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2) 343 343 else 344 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges, data2_1d)344 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,[data2_1d]) 345 345 endif 346 346 !#endif … … 382 382 ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data0) 383 383 !#else 384 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges, data0)384 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,[data0]) 385 385 !#endif 386 386 if (ierr.ne.NF_NOERR) then -
trunk/LMDZ.MARS/libf/phymars/wstats_mod.F90
r2563 r2573 18 18 19 19 integer,save :: count(istime) ! count tab to know the variable record 20 !$OMP THREADPRIVATE( istats,count)20 !$OMP THREADPRIVATE(count) 21 21 22 22 contains … … 537 537 ierr = NF_REDEF (nid) 538 538 #ifdef NC_DOUBLE 539 ierr = NF_DEF_VAR (nid,"altitude", NF_DOUBLE, 1, idim_llm,nvarid)540 #else 541 ierr = NF_DEF_VAR (nid,"altitude", NF_FLOAT, 1, idim_llm,nvarid)539 ierr = NF_DEF_VAR (nid,"altitude", NF_DOUBLE, 1,[idim_llm],nvarid) 540 #else 541 ierr = NF_DEF_VAR (nid,"altitude", NF_FLOAT, 1,[idim_llm],nvarid) 542 542 #endif 543 543 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",8,"altitude") … … 834 834 time(i)=i*24./istime 835 835 #ifdef NC_DOUBLE 836 ierr= NF_PUT_VARA_DOUBLE(nid,varid(4), i,1,time(i))837 #else 838 ierr= NF_PUT_VARA_REAL(nid,varid(4), i,1,time(i))836 ierr= NF_PUT_VARA_DOUBLE(nid,varid(4),[i],[1],time(i)) 837 #else 838 ierr= NF_PUT_VARA_REAL(nid,varid(4),[i],[1],time(i)) 839 839 #endif 840 840 enddo … … 859 859 860 860 do i=1,nbvar 861 varid=(i-1)*2+5861 nvarid=(i-1)*2+5 862 862 863 863 ! What's the variable's name? 864 ierr=NF_INQ_VARNAME(nid, varid,name)864 ierr=NF_INQ_VARNAME(nid,nvarid,name) 865 865 write(*,*) "OK variable ",name 866 866 ! Its units? 867 867 units=" " 868 ierr=NF_GET_ATT_TEXT(nid, varid,"units",units)868 ierr=NF_GET_ATT_TEXT(nid,nvarid,"units",units) 869 869 ! Its title? 870 870 title=" " 871 ierr=NF_GET_ATT_TEXT(nid, varid,"title",title)871 ierr=NF_GET_ATT_TEXT(nid,nvarid,"title",title) 872 872 ! Its number of dimensions? 873 ierr=NF_INQ_VARNDIMS(nid, varid,ndims)873 ierr=NF_INQ_VARNDIMS(nid,nvarid,ndims) 874 874 ! Its values? 875 875 … … 890 890 ! Extraction of the "source" variables 891 891 #ifdef NC_DOUBLE 892 ierr = NF_GET_VARA_DOUBLE(nid, varid,start,size,sum3d)893 ierr = NF_GET_VARA_DOUBLE(nid, varid+1,start,size,square3d)894 #else 895 ierr = NF_GET_VARA_REAL(nid, varid,start,size,sum3d)896 ierr = NF_GET_VARA_REAL(nid, varid+1,start,size,square3d)897 #endif 898 ! Calculation of these variables892 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,size,sum3d) 893 ierr = NF_GET_VARA_DOUBLE(nid,nvarid+1,start,size,square3d) 894 #else 895 ierr = NF_GET_VARA_REAL(nid,nvarid,start,size,sum3d) 896 ierr = NF_GET_VARA_REAL(nid,nvarid+1,start,size,square3d) 897 #endif 898 ! Calculation of these nvariables 899 899 mean3d=sum3d/count(lt) 900 900 sd3d=sqrt(max(0.,square3d/count(lt)-mean3d**2)) 901 901 ! Writing of the variables 902 902 #ifdef NC_DOUBLE 903 ierr = NF_PUT_VARA_DOUBLE(nid, varid,start,size,mean3d)904 ierr = NF_PUT_VARA_DOUBLE(nid, varid+1,start,size,sd3d)905 #else 906 ierr = NF_PUT_VARA_REAL(nid, varid,start,size,mean3d)907 ierr = NF_PUT_VARA_REAL(nid, varid+1,start,size,sd3d)903 ierr = NF_PUT_VARA_DOUBLE(nid,nvarid,start,size,mean3d) 904 ierr = NF_PUT_VARA_DOUBLE(nid,nvarid+1,start,size,sd3d) 905 #else 906 ierr = NF_PUT_VARA_REAL(nid,nvarid,start,size,mean3d) 907 ierr = NF_PUT_VARA_REAL(nid,nvarid+1,start,size,sd3d) 908 908 #endif 909 909 enddo … … 924 924 ! Extraction of the "source" variables 925 925 #ifdef NC_DOUBLE 926 ierr = NF_GET_VARA_DOUBLE(nid, varid,start,size,sum2d)927 ierr = NF_GET_VARA_DOUBLE(nid, varid+1,start,size,square2d)928 #else 929 ierr = NF_GET_VARA_REAL(nid, varid,start,size,sum2d)930 ierr = NF_GET_VARA_REAL(nid, varid+1,start,size,square2d)926 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,size,sum2d) 927 ierr = NF_GET_VARA_DOUBLE(nid,nvarid+1,start,size,square2d) 928 #else 929 ierr = NF_GET_VARA_REAL(nid,nvarid,start,size,sum2d) 930 ierr = NF_GET_VARA_REAL(nid,nvarid+1,start,size,square2d) 931 931 #endif 932 932 ! Calculation of these variables … … 935 935 ! Writing of the variables 936 936 #ifdef NC_DOUBLE 937 ierr = NF_PUT_VARA_DOUBLE(nid, varid,start,size,mean2d)938 ierr = NF_PUT_VARA_DOUBLE(nid, varid+1,start,size,sd2d)939 #else 940 ierr = NF_PUT_VARA_REAL(nid, varid,start,size,mean2d)941 ierr = NF_PUT_VARA_REAL(nid, varid+1,start,size,sd2d)937 ierr = NF_PUT_VARA_DOUBLE(nid,nvarid,start,size,mean2d) 938 ierr = NF_PUT_VARA_DOUBLE(nid,nvarid+1,start,size,sd2d) 939 #else 940 ierr = NF_PUT_VARA_REAL(nid,nvarid,start,size,mean2d) 941 ierr = NF_PUT_VARA_REAL(nid,nvarid+1,start,size,sd2d) 942 942 #endif 943 943 enddo
Note: See TracChangeset
for help on using the changeset viewer.