Changeset 3522
- Timestamp:
- Nov 15, 2024, 6:57:22 PM (3 weeks ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90
r3397 r3522 2 2 3 3 implicit none 4 5 real, save :: tab_cntrl_mod(100) 6 7 !$OMP THREADPRIVATE(tab_cntrl_mod) 4 8 5 9 contains … … 50 54 real,intent(out) :: emis(ngrid) ! surface emissivity 51 55 real,intent(out) :: albedo(ngrid,L_NSPECTV) ! albedo of the surface 52 real,intent(out) :: q2(ngrid,nlayer+1) ! 56 real,intent(out) :: q2(ngrid,nlayer+1) ! 53 57 real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface 54 58 ! real co2ice(ngrid) ! co2 ice cover 55 59 real,intent(out) :: cloudfrac(ngrid,nlayer) 56 60 real,intent(out) :: hice(ngrid), totcloudfrac(ngrid) 57 real,intent(out) :: pctsrf_sic(ngrid),tslab(ngrid,nslay) 61 real,intent(out) :: pctsrf_sic(ngrid),tslab(ngrid,nslay) 58 62 real,intent(out) :: tsea_ice(ngrid),sea_ice(ngrid) 59 63 real,intent(out) :: rnat(ngrid) … … 72 76 INTEGER nid, nvarid 73 77 INTEGER ierr, i, nsrf 74 ! integer isoil 78 ! integer isoil 75 79 ! INTEGER length 76 80 ! PARAMETER (length=100) … … 86 90 integer :: count 87 91 character(len=30) :: txt ! to store some text 88 92 89 93 INTEGER :: indextime=1 ! index of selected time, default value=1 90 94 logical :: found 91 95 92 96 character(len=8) :: modname="phyetat0" 93 97 … … 314 318 else 315 319 rnat(ig)=1. 316 endif 320 endif 317 321 enddo 318 322 endif ! of if (.not.found) … … 434 438 endif ! of if (startphy_file) 435 439 436 ! Non-orographic gravity waves 440 ! Non-orographic gravity waves 437 441 if (startphy_file) then 438 442 call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime) … … 486 490 end subroutine phyetat0 487 491 492 !====================================================================== 493 subroutine ini_tab_controle_dyn_xios(idayref) 494 495 use comcstfi_mod, only: g, mugaz, omeg, rad, rcp 496 use time_phylmdz_mod, only: daysec, dtphys 497 use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev 498 499 implicit none 500 501 integer*4, intent(in) :: idayref ! date (initial date for this run) 502 503 integer :: length, l 504 parameter (length = 100) 505 real :: tab_cntrl(length) ! run parameters are stored in this array 506 507 do l = 1,length 508 tab_cntrl(l) = 0. 509 enddo 510 tab_cntrl(1) = real(nbp_lon) 511 tab_cntrl(2) = real(nbp_lat-1) 512 tab_cntrl(3) = real(nbp_lev) 513 tab_cntrl(4) = real(idayref) 514 tab_cntrl(5) = rad 515 tab_cntrl(6) = omeg 516 tab_cntrl(7) = g 517 tab_cntrl(8) = mugaz 518 tab_cntrl(9) = rcp 519 tab_cntrl(10) = daysec 520 tab_cntrl(11) = dtphys 521 522 tab_cntrl_mod = tab_cntrl 523 524 end subroutine ini_tab_controle_dyn_xios 525 488 526 end module phyetat0_mod -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r3437 r3522 38 38 igcm_co2_ice, nesp, is_chim, is_condensable,constants_epsi_generic 39 39 use time_phylmdz_mod, only: ecritphy, iphysiq, nday 40 use phyetat0_mod, only: phyetat0 40 use phyetat0_mod, only: phyetat0,tab_cntrl_mod 41 41 use surfini_mod, only: surfini 42 42 use wstats_mod, only: callstats, wstats, mkstats … … 90 90 use datafile_mod, only: datadir 91 91 use newton_cooling_hotJ, only: newtcool_MOCHA ! LT, adding for MOCHA protocol 92 92 93 93 #ifndef MESOSCALE 94 use vertical_layers_mod, only: presnivs,pseudoalt94 USE vertical_layers_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt 95 95 use mod_phys_lmdz_omp_data, ONLY: is_omp_master 96 96 #else … … 113 113 use wxios, only: wxios_context_init, xios_context_finalize 114 114 #endif 115 use write_output_mod, only: write_output 115 116 116 117 implicit none … … 315 316 real zdtsdif(ngrid) ! Turbdiff/vdifc routines. 316 317 real zdtsurf_hyd(ngrid) ! Hydrol routine. 317 318 318 319 ! For Thermosphere : (K/s) 319 320 real zdtconduc(ngrid,nlayer) … … 462 463 real int_dtaui1(ngrid,nlayer,L_NSPECTI),int_dtauv1(ngrid,nlayer,L_NSPECTV) ! For optical thickness diagnostics. 463 464 real tf, ntf 464 465 465 466 real net_fluxsurf_lw(ngrid) ! net longwave flux at the surface (for diagnostics only) 466 467 … … 468 469 469 470 real muvar(ngrid,nlayer+1) ! For Runaway Greenhouse 1D study. By RW 470 471 471 472 ! For fixed variable molar mass 472 473 real, dimension(:),allocatable,save :: p_var … … 535 536 zdtlw(:,:) = 0.0 536 537 zdtconduc(:,:) = 0.0 537 538 538 539 ! Initialize fixed variable mu 539 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 540 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 540 541 541 542 if(varspec) then … … 546 547 mu_var = 0.0 547 548 frac_var = 0.0 548 muvari = 0.0 549 muvari = 0.0 549 550 dt_file=TRIM(varspec_data) 550 551 open(33,file=dt_file,form='formatted',status='old',iostat=ios) … … 557 558 do k=1,nvarlayer 558 559 read(33,*) p_var(k), mu_var(k),frac_var(k,1:ngasmx) 559 !The order of columns in frac_var must correspond to order of molecules gases.def 560 !The order of columns in frac_var must correspond to order of molecules gases.def 560 561 !The format of your file must be: 561 562 ! pressure(k) molar_mass(k), molar_fraction_of_gas_1(k), molar_fraction_of_gas_2(k),..., molar_fraction_of_gas_ngasmx(k) … … 675 676 call ocean_slab_get_vars(ngrid, tslab, tice, sea_ice, flux_g, & 676 677 dt_hdiff, dt_ekman, dt_gm) 677 678 678 679 endif ! end of 'ok_slab_ocean'. 679 680 … … 1723 1724 dqmoist(1:ngrid,1:nlayer,1:nq)=0. 1724 1725 dtmoist(1:ngrid,1:nlayer)=0. 1725 1726 1726 1727 ! Moist Convective Adjustment. 1727 1728 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1728 1729 call moistadj_generic(ngrid,nlayer,nq,pt,pq,pdq,pplev,pplay,dtmoist,dqmoist,ptimestep,rneb_man) 1729 1730 1730 1731 pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) & 1731 1732 + dqmoist(1:ngrid,1:nlayer,1:nq) … … 1738 1739 call planetwide_minval(dtmoist(:,:),dtmoist_min) 1739 1740 madjdEz(:,:)=cpp*mass(:,:)*dtmoist(:,:) 1740 1741 1741 1742 do ig=1,ngrid 1742 1743 madjdE(ig) = cpp*SUM(mass(:,:)*dtmoist(:,:)) 1743 1744 enddo 1744 1745 1745 1746 if (is_master) then 1746 1747 print*,'In moistadj_generic atmospheric energy change =',dEtot,' W m-2' … … 1753 1754 massarea(:,:)*dqmoist(:,:,2)*ptimestep/totarea_planet,dWtot) 1754 1755 if (is_master) print*,'In moistadj_generic atmospheric GCS change =',dWtot,' kg m-2' 1755 1756 1756 1757 endif ! end of 'enertest' 1757 1758 else … … 1997 1998 tsea_ice, -zdqsdif(:,igcm_h2o_vap), taux, tauy, zmasq) 1998 1999 1999 call ocean_slab_frac(pctsrf_sic, zmasq) 2000 2000 call ocean_slab_frac(pctsrf_sic, zmasq) 2001 2001 2002 call ocean_slab_get_vars(ngrid, tslab, tice, sea_ice, flux_g, & 2002 2003 dt_hdiff, dt_ekman, dt_gm) … … 2004 2005 !!! call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, & 2005 2006 !!! dt_hdiff, dt_ekman, dt_gm) 2006 2007 2007 2008 !! sea_ice defines the sea ice thickness in kg/m2 2008 2009 !! pctsrf_sic defines the percentage of the oceanic grid that is covered by sea ice (between 0 and **almost** 1) … … 2398 2399 if (ngrid.ne.1) then 2399 2400 write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin 2400 2401 2401 2402 if (ok_slab_ocean) then 2402 2403 ! fetch "ocean variables" to ensure they are stored … … 2520 2521 !----------------------------------------------------------------------------------------------------- 2521 2522 2522 call writediagfi(ngrid,"Ls","solar longitude","deg",0,zls*180./pi) 2523 call writediagfi(ngrid,"Lss","sub solar longitude","deg",0,zlss*180./pi) 2524 call writediagfi(ngrid,"RA","right ascension","deg",0,right_ascen*180./pi) 2525 call writediagfi(ngrid,"Declin","solar declination","deg",0,declin*180./pi) 2526 call writediagfi(ngrid,"tsurf","Surface temperature","K",2,tsurf) 2527 call writediagfi(ngrid,"ps","Surface pressure","Pa",2,ps) 2528 call writediagfi(ngrid,"temp","temperature","K",3,zt) 2529 call writediagfi(ngrid,"teta","potential temperature","K",3,zh) 2530 call writediagfi(ngrid,"u","Zonal wind","m.s-1",3,zu) 2531 call writediagfi(ngrid,"v","Meridional wind","m.s-1",3,zv) 2532 call writediagfi(ngrid,"w","Vertical wind","m.s-1",3,pw) 2533 call writediagfi(ngrid,"p","Pressure","Pa",3,pplay) 2523 call write_output("Ls","solar longitude","deg",zls*180./pi) 2524 call write_output("Lss","sub solar longitude","deg",zlss*180./pi) 2525 call write_output("RA","right ascension","deg",right_ascen*180./pi) 2526 call write_output("Declin","solar declination","deg",declin*180./pi) 2527 call write_output("dist_star","dist_star","AU",dist_star) 2528 2529 call write_output("tsurf","Surface temperature","K",tsurf) 2530 call write_output("ps","Surface pressure","Pa",ps) 2531 call write_output("emis","Emissivity","",emis) 2532 call write_output("temperature","temperature","K",zt) 2533 call write_output("teta","potential temperature","K",zh) 2534 call write_output("u","Zonal wind","m.s-1",zu) 2535 call write_output("v","Meridional wind","m.s-1",zv) 2536 call write_output("w","Vertical wind","m.s-1",pw) 2537 call write_output("p","Pressure","Pa",pplay) 2538 call write_output("omega","omega","Pa/s",omega) 2534 2539 2535 2540 ! Subsurface temperatures 2536 2541 ! call writediagsoil(ngrid,"tsurf","Surface temperature","K",2,tsurf) 2537 ! call writediagsoil(ngrid,"temp","temperature","K",3,tsoil)2538 2542 2539 2543 ! Oceanic layers 2540 2544 if(ok_slab_ocean) then 2541 call write diagfi(ngrid,"pctsrf_sic","pct ice/sea","",2,pctsrf_sic)2542 call write diagfi(ngrid,"tsea_ice","top layer temp, snow/ice","K",2,tsea_ice)2543 ! call write diagfi(ngrid,"tice","sea ice temperature","K",2,tice)2544 call write diagfi(ngrid,"sea_ice","sea ice","kg/m2",2,sea_ice)2545 call write diagfi(ngrid,"tslab1","tslab1","K",2,tslab(:,1))2546 call write diagfi(ngrid,"tslab2","tslab2","K",2,tslab(:,2))2547 call write diagfi(ngrid,"dt_hdiff1","dt_hdiff1","W m-2",2,dt_hdiff(:,1))2548 call write diagfi(ngrid,"dt_hdiff2","dt_hdiff2","W m-2",2,dt_hdiff(:,2))2549 call write diagfi(ngrid,"dt_ekman1","dt_ekman1","W m-2",2,dt_ekman(:,1))2550 call write diagfi(ngrid,"dt_ekman2","dt_ekman2","W m-2",2,dt_ekman(:,2))2551 call write diagfi(ngrid,"dt_gm1","dt_gm1","W m-2",2,dt_gm(:,1))2552 call write diagfi(ngrid,"dt_gm2","dt_gm2","W m-2",2,dt_gm(:,2))2553 call write diagfi(ngrid,"rnat","nature of the surface","",2,rnat)2554 call write diagfi(ngrid,"sensibFlux","sensible heat flux","w.m^-2",2,sensibFlux)2555 call write diagfi(ngrid,"latentFlux","latent heat flux","w.m^-2",2,zdqsdif(:,igcm_h2o_vap)*RLVTT)2545 call write_output("pctsrf_sic","pct ice/sea","",pctsrf_sic) 2546 call write_output("tsea_ice","top layer temp, snow/ice","K",tsea_ice) 2547 ! call write_output("tice","sea ice temperature","K",tice) 2548 call write_output("sea_ice","sea ice","kg/m2",sea_ice) 2549 call write_output("tslab1","tslab1","K",tslab(:,1)) 2550 call write_output("tslab2","tslab2","K",tslab(:,2)) 2551 call write_output("dt_hdiff1","dt_hdiff1","W m-2",dt_hdiff(:,1)) 2552 call write_output("dt_hdiff2","dt_hdiff2","W m-2",dt_hdiff(:,2)) 2553 call write_output("dt_ekman1","dt_ekman1","W m-2",dt_ekman(:,1)) 2554 call write_output("dt_ekman2","dt_ekman2","W m-2",dt_ekman(:,2)) 2555 call write_output("dt_gm1","dt_gm1","W m-2",dt_gm(:,1)) 2556 call write_output("dt_gm2","dt_gm2","W m-2",dt_gm(:,2)) 2557 call write_output("rnat","nature of the surface","",rnat) 2558 call write_output("sensibFlux","sensible heat flux","w.m^-2",sensibFlux) 2559 call write_output("latentFlux","latent heat flux","w.m^-2",zdqsdif(:,igcm_h2o_vap)*RLVTT) 2556 2560 endif 2557 2561 2558 2562 ! Thermal plume model 2559 2563 if (calltherm) then 2560 call write diagfi(ngrid,'entr','Entrainment','kg m$^{-2}$ s$^{-1}$', 3, entr)2561 call write diagfi(ngrid,'detr','Detrainment','kg m$^{-2}$ s$^{-1}$', 3, detr)2562 call write diagfi(ngrid,'fm','Mass flux','kg m$^{-2}$ s$^{-1}$', 3, fm_bis)2563 call write diagfi(ngrid,'w_plm','Squared vertical velocity','m s$^{-1}$', 3, zw2_bis)2564 call write diagfi(ngrid,'fraca','Updraft fraction','', 3, fraca)2565 call write diagfi(ngrid,"zdttherm","dt due to plumes","K-1 s-1",3,zdttherm) !ALS242564 call write_output('entr','Entrainment','kg m$^{-2}$ s$^{-1}$', entr) 2565 call write_output('detr','Detrainment','kg m$^{-2}$ s$^{-1}$', detr) 2566 call write_output('fm','Mass flux','kg m$^{-2}$ s$^{-1}$', fm_bis) 2567 call write_output('w_plm','Squared vertical velocity','m s$^{-1}$', zw2_bis) 2568 call write_output('fraca','Updraft fraction','', fraca) 2569 call write_output("zdttherm","dt due to plumes","K-1 s-1",zdttherm) !ALS24 2566 2570 IF (tracer) THEN 2567 call write diagfi(ngrid,"zdqtherm","dq due to plumes, iq = 1","kg kg-1 s-1",3,&2571 call write_output("zdqtherm","dq due to plumes, iq = 1","kg kg-1 s-1",& 2568 2572 zdqtherm(1:ngrid,1:nlayer,1)) !ALS24 2569 call write diagfi(ngrid,"zdqtherm2","dq due to plumes; iq = 2","kg kg-1 s-1",3,&2573 call write_output("zdqtherm2","dq due to plumes; iq = 2","kg kg-1 s-1",& 2570 2574 zdqtherm(1:ngrid,1:nlayer,2)) !ALS24 2571 2575 ENDIF … … 2574 2578 ! GW non-oro outputs 2575 2579 if (calllott_nonoro) then 2576 call WRITEDIAGFI(ngrid,"dugwno","GW non-oro dU","m/s2", 3,d_u_hin)2577 call WRITEDIAGFI(ngrid,"dvgwno","GW non-oro dV","m/s2", 3,d_v_hin)2580 call write_output("dugwno","GW non-oro dU","m/s2", d_u_hin) 2581 call write_output("dvgwno","GW non-oro dV","m/s2", d_v_hin) 2578 2582 endif 2579 2583 … … 2581 2585 if(callrad.and.(.not.newtonian))then 2582 2586 2583 call writediagfi(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent) 2584 !call writediagfi(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1)) 2585 call writediagfi(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn) 2586 call writediagfi(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw) 2587 call writediagfi(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw) 2588 call writediagfi(ngrid,"shad","rings"," ", 2, fract) 2589 2587 call write_output("ALB","Surface albedo"," ",albedo_equivalent) 2588 call write_output("ASR","absorbed stellar rad.","W m-2",fluxabs_sw) 2589 call write_output("ISR","incoming stellar rad.","W m-2",fluxtop_dn) 2590 call write_output("OLR","outgoing longwave rad.","W m-2",fluxtop_lw) 2591 call write_output("DYN","dynamical heat input","W m-2",fluxdyn) 2592 call write_output("shad","rings"," ", fract) 2590 2593 ! call writediagfi(ngrid,"ASRcs","absorbed stellar rad (cs).","W m-2",2,fluxabs_sw1) 2591 2594 ! call writediagfi(ngrid,"OLRcs","outgoing longwave rad (cs).","W m-2",2,fluxtop_lw1) … … 2597 2600 2598 2601 if(ok_slab_ocean) then 2599 call write diagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrdocean)2602 call write_output("GND","heat flux from ground","W m-2",fluxgrdocean) 2600 2603 else 2601 call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrd) 2602 endif 2603 2604 call writediagfi(ngrid,"DYN","dynamical heat input","W m-2",2,fluxdyn) 2605 2604 call write_output("GND","heat flux from ground","W m-2",fluxgrd) 2605 endif 2606 2606 endif ! end of 'callrad' 2607 2607 … … 2609 2609 2610 2610 if (calldifv) then 2611 2612 call writediagfi(ngrid,"q2","turbulent kinetic energy","J.kg^-1",3,q2) 2613 call writediagfi(ngrid,"sensibFlux","sensible heat flux","w.m^-2",2,sensibFlux) 2614 2611 call write_output("q2","turbulent kinetic energy","J.kg^-1",q2) 2612 call write_output("sensibFlux","sensible heat flux","w.m^-2",sensibFlux) 2615 2613 ! call writediagfi(ngrid,"dEzdiff","turbulent diffusion heating (-sensible flux)","w.m^-2",3,dEzdiff) 2616 2614 ! call writediagfi(ngrid,"dEdiff","integrated turbulent diffusion heating (-sensible flux)","w.m^-2",2,dEdiff) 2617 2615 ! call writediagfi(ngrid,"dEdiffs","In TurbDiff (correc rad+latent heat) surf nrj change","w.m^-2",2,dEdiffs) 2618 2619 2616 endif 2620 2617 2621 2618 if (corrk) then 2622 call write diagfi(ngrid,"dEzradsw","radiative heating","w.m^-2",3,dEzradsw)2623 call write diagfi(ngrid,"dEzradlw","radiative heating","w.m^-2",3,dEzradlw)2619 call write_output("dEzradsw","radiative heating","w.m^-2",dEzradsw) 2620 call write_output("dEzradlw","radiative heating","w.m^-2",dEzradlw) 2624 2621 endif 2625 2622 2626 2623 if(watercond) then 2627 2628 call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE) 2624 call write_output("lscaledE","heat from largescale","W m-2",lscaledE) 2629 2625 if ((.not.calltherm).and.moistadjustment) then 2630 call write diagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)2626 call write_output("madjdE","heat from moistadj","W m-2",madjdE) 2631 2627 endif 2632 call writediagfi(ngrid,"qsatatm","atm qsat"," ",3,qsat) 2633 2634 ! call writediagfi(ngrid,"lscaledEz","heat from largescale","W m-2",3,lscaledEz) 2635 ! call writediagfi(ngrid,"madjdEz","heat from moistadj","W m-2",3,madjdEz) 2636 ! call writediagfi(ngrid,"h2o_max_col","maximum H2O column amount","kg.m^-2",2,H2Omaxcol) 2637 2628 call write_output("qsatatm","atm qsat"," ",qsat) 2629 ! call write_output("lscaledEz","heat from largescale","W m-2",lscaledEz) 2630 ! call write_output("madjdEz","heat from moistadj","W m-2",madjdEz) 2631 ! call write_output("h2o_max_col","maximum H2O column amount","kg.m^-2",H2Omaxcol) 2638 2632 endif 2639 2633 2640 2634 if (generic_condensation) then 2641 2642 call writediagfi(ngrid,"genericconddE","heat from generic condensation","W m-2",2,genericconddE) 2643 call writediagfi(ngrid,"dt_generic_condensation","heating from generic condensation","K s-1",3,dt_generic_condensation) 2644 2635 call write_output("genericconddE","heat from generic condensation","W m-2",genericconddE) 2636 call write_output("dt_generic_condensation","heating from generic condensation","K s-1",dt_generic_condensation) 2645 2637 endif 2646 2638 … … 2652 2644 do nw=1,L_NSPECTV 2653 2645 write(str2,'(i2.2)') nw 2654 call write diagfi(ngrid,'dtauv'//str2,'Layer optical thickness attenuation in VI band '//str2,'',1,int_dtauv(:,nlayer:1:-1,nw))2646 call write_output('dtauv'//str2,'Layer optical thickness attenuation in VI band '//str2,'',int_dtauv(:,nlayer:1:-1,nw)) 2655 2647 enddo 2656 2648 do nw=1,L_NSPECTI 2657 2649 write(str2,'(i2.2)') nw 2658 call write diagfi(ngrid,'dtaui'//str2,'Layer optical thickness attenuation in IR band '//str2,'',1,int_dtaui(:,nlayer:1:-1,nw))2650 call write_output('dtaui'//str2,'Layer optical thickness attenuation in IR band '//str2,'',int_dtaui(:,nlayer:1:-1,nw)) 2659 2651 enddo 2660 2652 endif 2661 2653 2662 2663 2654 ! Temporary inclusions for heating diagnostics. 2664 call writediagfi(ngrid,"zdtsw","SW heating","T s-1",3,zdtsw)2665 call writediagfi(ngrid,"zdtlw","LW heating","T s-1",3,zdtlw)2666 call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)2667 call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)2668 2669 if (tracer .or. water) call write diagfi(ngrid,"dtmoistadj","moist adj heating","K s-1",3,dtmoist)2670 if (calladj) call write diagfi(ngrid,"dtdryadj","dry adj heating","K s-1",3,zdtadj)2655 call write_output("zdtsw","SW heating","T s-1",zdtsw) 2656 call write_output("zdtlw","LW heating","T s-1",zdtlw) 2657 call write_output("dtrad","radiative heating","K s-1",dtrad) 2658 call write_output("zdtdyn","Dyn. heating","T s-1",zdtdyn) 2659 2660 if (tracer .or. water) call write_output("dtmoistadj","moist adj heating","K s-1",dtmoist) 2661 if (calladj) call write_output("dtdryadj","dry adj heating","K s-1",zdtadj) 2671 2662 2672 2663 ! For Debugging. … … 2677 2668 ! Output aerosols. 2678 2669 if (igcm_co2_ice.ne.0.and.iaero_co2.ne.0) & 2679 call write diagfi(ngrid,'CO2ice_reff','CO2ice_reff','m',3,reffrad(1,1,iaero_co2))2670 call write_output('CO2ice_reff','CO2ice_reff','m',reffrad(1,1,iaero_co2)) 2680 2671 if (igcm_h2o_ice.ne.0.and.iaero_h2o.ne.0) & 2681 call write diagfi(ngrid,'H2Oice_reff','H2Oice_reff','m',3,reffrad(:,:,iaero_h2o))2672 call write_output('H2Oice_reff','H2Oice_reff','m',reffrad(:,:,iaero_h2o)) 2682 2673 if (igcm_co2_ice.ne.0.and.iaero_co2.ne.0) & 2683 call write diagfi(ngrid,'CO2ice_reffcol','CO2ice_reffcol','um kg m^-2',2,reffcol(1,iaero_co2))2674 call write_output('CO2ice_reffcol','CO2ice_reffcol','um kg m^-2',reffcol(1,iaero_co2)) 2684 2675 if (igcm_h2o_ice.ne.0.and.iaero_h2o.ne.0) & 2685 call write diagfi(ngrid,'H2Oice_reffcol','H2Oice_reffcol','um kg m^-2',2,reffcol(1,iaero_h2o))2676 call write_output('H2Oice_reffcol','H2Oice_reffcol','um kg m^-2',reffcol(1,iaero_h2o)) 2686 2677 2687 2678 ! Output tracers. … … 2689 2680 2690 2681 do iq=1,nq 2691 call write diagfi(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))2692 call write diagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', &2693 'kg m^-2',2,qsurf_hist(1,iq) )2694 call write diagfi(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col', &2695 'kg m^-2',2,qcol(1,iq) )2696 ! call writediagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', &2697 ! 'kg m^-2',2,qsurf(1,iq) )2682 call write_output(noms(iq),noms(iq),'kg/kg',zq(:,:,iq)) 2683 call write_output(trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', & 2684 'kg m^-2',qsurf_hist(1,iq) ) 2685 call write_output(trim(noms(iq))//'_col',trim(noms(iq))//'_col', & 2686 'kg m^-2',qcol(:,iq) ) 2687 ! call write_output(trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', & 2688 ! 'kg m^-2',qsurf(:,iq) ) 2698 2689 2699 2690 if(watercond.or.CLFvarying)then 2700 call write diagfi(ngrid,"rneb_man","H2O cloud fraction (conv)"," ",3,rneb_man)2701 call write diagfi(ngrid,"rneb_lsc","H2O cloud fraction (large scale)"," ",3,rneb_lsc)2702 call write diagfi(ngrid,"CLF","H2O cloud fraction"," ",3,cloudfrac)2703 call write diagfi(ngrid,"CLFt","H2O column cloud fraction"," ",2,totcloudfrac)2704 call write diagfi(ngrid,"RH","relative humidity"," ",3,RH)2705 call write diagfi(ngrid,"vteta","virtual potential temperature","K",3,zh * (1.+(1./epsi-1.) * &2691 call write_output("rneb_man","H2O cloud fraction (conv)"," ",rneb_man) 2692 call write_output("rneb_lsc","H2O cloud fraction (large scale)"," ",rneb_lsc) 2693 call write_output("CLF","H2O cloud fraction"," ",cloudfrac) 2694 call write_output("CLFt","H2O column cloud fraction"," ",totcloudfrac) 2695 call write_output("RH","relative humidity"," ",RH) 2696 call write_output("vteta","virtual potential temperature","K",zh * (1.+(1./epsi-1.) * & 2706 2697 zq(1:ngrid,1:nlayer,1))) 2707 2698 endif 2708 2699 2709 2700 if(waterrain)then 2710 call write diagfi(ngrid,"rain","rainfall","kg m-2 s-1",2,zdqsrain)2711 call write diagfi(ngrid,"snow","snowfall","kg m-2 s-1",2,zdqssnow)2712 call write diagfi(ngrid,"reevap","reevaporation of precipitation","kg m-2 s-1",2,reevap_precip)2701 call write_output("rain","rainfall","kg m-2 s-1",zdqsrain) 2702 call write_output("snow","snowfall","kg m-2 s-1",zdqssnow) 2703 call write_output("reevap","reevaporation of precipitation","kg m-2 s-1",reevap_precip) 2713 2704 endif 2714 2705 2715 2706 if(generic_condensation)then 2707 call write_output("CLF","GCS cloud fraction"," ",cloudfrac) 2708 !AF24: TODO fix rneb_generic and RH_generic failure with write_output() 2709 ! call write_output("rneb_generic","GCS cloud fraction (generic condensation)"," ",rneb_generic) 2710 ! call write_output("RH_generic","GCS relative humidity"," ",RH_generic) 2716 2711 call writediagfi(ngrid,"rneb_generic","GCS cloud fraction (generic condensation)"," ",3,rneb_generic) 2717 call writediagfi(ngrid,"CLF","GCS cloud fraction"," ",3,cloudfrac)2718 2712 call writediagfi(ngrid,"RH_generic","GCS relative humidity"," ",3,RH_generic) 2719 call write diagfi(ngrid,"vteta","virtual potential temperature","K",3,zh * (1.+(1./epsi_generic-1.) * &2713 call write_output("vteta","virtual potential temperature","K",zh * (1.+(1./epsi_generic-1.) * & 2720 2714 zq(1:ngrid,1:nlayer,1) )) 2721 2715 endif 2722 2716 2723 2717 if(generic_rain)then 2724 call write diagfi(ngrid,"rain","generic rainfall","kg m-2 s-1",2,zdqsrain_generic)2725 call write diagfi(ngrid,"snow","generic snowfall","kg m-2 s-1",2,zdqssnow_generic)2726 call write diagfi(ngrid,"reevap","generic reevaporation of precipitation","kg m-2 s-1",2,reevap_precip_generic)2718 call write_output("rain","generic rainfall","kg m-2 s-1",zdqsrain_generic) 2719 call write_output("snow","generic snowfall","kg m-2 s-1",zdqssnow_generic) 2720 call write_output("reevap","generic reevaporation of precipitation","kg m-2 s-1",reevap_precip_generic) 2727 2721 endif 2728 2722 2729 2723 if((hydrology).and.(.not.ok_slab_ocean))then 2730 call write diagfi(ngrid,"hice","oceanic ice height","m",2,hice)2724 call write_output("hice","oceanic ice height","m",hice) 2731 2725 endif 2732 2726 2733 call writediagfi(ngrid,"tau_col","Total aerosol optical depth","[]",2,tau_col) 2734 2727 call write_output("tau_col","Total aerosol optical depth","[]",tau_col) 2735 2728 enddo ! end of 'nq' loop 2736 2737 2729 endif ! end of 'tracer' 2738 2739 2730 2740 2731 ! Output spectrum. … … 2835 2826 ! Send fields to XIOS: (NB these fields must also be defined as 2836 2827 ! <field id="..." /> in context_lmdz_physics.xml to be correctly used) 2837 CALL send_xios_field("ls",zls) 2838 2839 CALL send_xios_field("ps",ps) 2840 CALL send_xios_field("area",cell_area) 2841 CALL send_xios_field("p",pplay) 2842 CALL send_xios_field("temperature",zt) 2843 CALL send_xios_field("u",zu) 2844 CALL send_xios_field("v",zv) 2845 CALL send_xios_field("omega",omega) 2846 2847 IF (calltherm) THEN 2848 CALL send_xios_field('w_plm',zw2_bis) 2849 CALL send_xios_field('entr',entr) 2850 CALL send_xios_field('detr',detr) 2851 ! CALL send_xios_field('fm',fm_bis) 2852 ! CALL send_xios_field('fraca',fraca) 2853 ENDIF 2828 CALL send_xios_field("controle",tab_cntrl_mod,1) 2829 2830 CALL send_xios_field("ap",ap,1) 2831 CALL send_xios_field("bp",bp,1) 2832 CALL send_xios_field("aps",aps,1) 2833 CALL send_xios_field("bps",bps,1) 2854 2834 2855 2835 IF (water) THEN 2856 CALL send_xios_field('h2o_vap',zq(:,:,igcm_h2o_vap))2857 CALL send_xios_field('h2o_ice',zq(:,:,igcm_h2o_ice))2858 2859 2836 CALL send_xios_field('h2o_layer1',zq(:,1,igcm_h2o_vap)) 2860 2837 CALL send_xios_field('co2_layer1',zq(:,1,igcm_co2_ice)) 2861 CALL send_xios_field('tsurf',tsurf)2862 CALL send_xios_field('co2ice',qsurf(1:ngrid,igcm_co2_ice))2863 CALL send_xios_field('h2o_ice_s',qsurf(1:ngrid,igcm_h2o_ice))2864 2838 ENDIF 2865 2866 CALL send_xios_field("ISR",fluxtop_dn)2867 CALL send_xios_field("OLR",fluxtop_lw)2868 CALL send_xios_field("ASR",fluxabs_sw)2869 2839 2870 2840 if (specOLR .and. corrk) then -
trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90
r1543 r3522 1 module writediagsoil_mod 2 3 implicit none 4 5 contains 6 1 7 subroutine writediagsoil(ngrid,name,title,units,dimpx,px) 2 8 … … 86 92 stop 87 93 endif 88 94 89 95 ! Set output sample rate 90 96 isample=int(ecritphy) ! same as for diagfi outputs 91 97 ! Note ecritphy is known from control.h 92 98 93 99 ! Create output NetCDF file 94 100 if (is_master) then … … 129 135 enddo 130 136 endif 131 137 132 138 ! write "header" of file (longitudes, latitudes, geopotential, ...) 133 139 if (klon_glo>1) then ! general 3D case … … 138 144 139 145 endif ! of if (is_master) 140 146 141 147 ! set zitau to -1 to be compatible with zitau incrementation step below 142 148 zitau=-1 143 149 144 150 else 145 151 ! If not an initialization call, simply open the NetCDF file … … 164 170 date=float(zitau+1)/float(day_step) 165 171 ! Note: day_step is known from control.h 166 172 167 173 if (is_master) then 168 174 ! Get NetCDF ID for "time" … … 176 182 if (ierr.ne.NF_NOERR) then 177 183 write(*,*)"writediagsoil: Failed writing date to time variable" 178 stop 184 stop 179 185 endif 180 186 endif ! of if (is_master) … … 217 223 endif 218 224 #endif 219 225 220 226 ! B. Write (append) the variable to the NetCDF file 221 227 if (is_master) then … … 235 241 call def_var(nid,name,title,units,4,id,varid,ierr) 236 242 endif ! of if (ierr.ne.NF_NOERR) 237 243 238 244 ! B.2. Prepare things to be able to write/append the variable 239 245 corners(1)=1 … … 241 247 corners(3)=1 242 248 corners(4)=ntime 243 249 244 250 if (klon_glo==1) then 245 251 edges(1)=1 … … 250 256 edges(3)=nsoilmx 251 257 edges(4)=1 252 258 253 259 ! B.3. Write the slab of data 254 260 !#ifdef NC_DOUBLE … … 324 330 corners(2)=1 325 331 corners(3)=ntime 326 332 327 333 if (klon_glo==1) then 328 334 edges(1)=1 … … 332 338 edges(2)=nbp_lat 333 339 edges(3)=1 334 340 335 341 ! B.3. Write the slab of data 336 342 !#ifdef NC_DOUBLE … … 373 379 ! B.2. Prepare things to be able to write/append the variable 374 380 corners(1)=ntime 375 381 376 382 edges(1)=1 377 383 … … 396 402 397 403 end subroutine writediagsoil 404 405 end module writediagsoil_mod -
trunk/LMDZ.GENERIC/libf/phystd/xios_output_mod.F90
r2735 r3522 2 2 3 3 IMPLICIT NONE 4 4 5 5 INTEGER,PRIVATE,SAVE :: time_it=0 ! store number of iterations with calls to XIOS since start 6 6 ! does not need to be threadprivate; managed by omp master 7 7 8 8 CHARACTER(LEN=*), PARAMETER :: context_id= "LMDZ" ! same as in context_lmdz_physics.xml 9 9 10 10 #ifdef CPP_XIOS 11 11 12 12 INTERFACE send_xios_field 13 MODULE PROCEDURE histwrite0d_xios,histwrite 2d_xios,histwrite3d_xios!,histwrite1d_xios13 MODULE PROCEDURE histwrite0d_xios,histwrite1d_xios,histwrite2d_xios,histwrite3d_xios 14 14 END INTERFACE 15 15 16 16 17 17 CONTAINS … … 36 36 USE wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_closedef 37 37 IMPLICIT NONE 38 38 39 39 REAL,INTENT(IN) :: day ! Number of elapsed sols since reference Ls=0. 40 40 REAL,INTENT(IN) :: timeofday ! "Universal time", given as fraction of sol (e.g.: 0.5 for noon). … … 46 46 REAL,INTENT(IN) :: wnoi(:) ! Array of wavenumbers at the spectral interval centers for the infrared. 47 47 real,intent(in) :: wnov (:) !Array of wavenumbers at the spectral interval centers for the visible. 48 48 49 49 INTEGER :: data_ibegin, data_iend 50 50 TYPE(xios_duration) :: timestep 51 51 TYPE(xios_date) :: time_origin 52 52 TYPE(xios_date) :: start_date 53 53 54 54 !$OMP BARRIER 55 55 !$OMP MASTER … … 74 74 ! IF (mpi_rank == 0) THEN 75 75 ! data_ibegin = 0 76 ! ELSE 76 ! ELSE 77 77 ! data_ibegin = ii_begin - 1 78 78 ! END IF … … 129 129 !NB: it would make more sense to define months and their length in the 130 130 ! xml files and not to have them hard coded here.... to be improved... 131 131 132 132 ! time origin of the simulation (default: 1st year/1st month/1st day, Ls=0) 133 133 time_origin=xios_date(1,1,1,0,0,0) … … 151 151 !$OMP END MASTER 152 152 !$OMP BARRIER 153 153 154 154 END SUBROUTINE initialize_xios_output 155 155 … … 159 159 USE xios 160 160 IMPLICIT NONE 161 !$OMP BARRIER 161 !$OMP BARRIER 162 162 !$OMP MASTER 163 163 CALL xios_context_finalize 164 !$OMP END MASTER 165 !$OMP BARRIER 166 164 !$OMP END MASTER 165 !$OMP BARRIER 166 167 167 END SUBROUTINE finalize_xios_output 168 168 … … 176 176 time_it=time_it+1 177 177 CALL xios_update_calendar(time_it) 178 !$OMP END MASTER 178 !$OMP END MASTER 179 179 END SUBROUTINE update_xios_timestep 180 180 … … 189 189 CALL xios_get_handle(context_id,ctx_hdl) 190 190 CALL xios_set_current_context(ctx_hdl) 191 !$OMP END MASTER 191 !$OMP END MASTER 192 192 END SUBROUTINE set_xios_context 193 193 … … 198 198 USE print_control_mod, ONLY: prt_level, lunout 199 199 IMPLICIT NONE 200 200 201 201 CHARACTER(LEN=*), INTENT(IN) :: field_name 202 202 REAL, INTENT(IN) :: field 203 203 204 204 IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite0d_xios ',trim(field_name) 205 205 206 206 !$OMP MASTER 207 207 CALL xios_send_field(field_name,field) 208 208 !$OMP END MASTER 209 209 210 210 IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite0d_xios ',trim(field_name) 211 211 212 212 END SUBROUTINE histwrite0d_xios 213 214 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 215 216 SUBROUTINE histwrite1d_xios(field_name,field,dimens) 217 USE xios, ONLY: xios_send_field 218 USE print_control_mod, ONLY: prt_level, lunout 219 IMPLICIT NONE 220 221 CHARACTER(LEN=*), INTENT(IN) :: field_name 222 REAL, DIMENSION(:), INTENT(IN) :: field 223 INTEGER, INTENT(IN) :: dimens 224 IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite1d_xios ',trim(field_name) 225 !$OMP MASTER 226 CALL xios_send_field(field_name,field) 227 !$OMP END MASTER 228 229 IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite1d_xios ',trim(field_name) 230 231 END SUBROUTINE histwrite1d_xios 213 232 214 233 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 226 245 CHARACTER(LEN=*), INTENT(IN) :: field_name 227 246 REAL, DIMENSION(:), INTENT(IN) :: field 228 247 229 248 REAL,DIMENSION(klon_mpi) :: buffer_omp 230 249 REAL :: Field2d(nbp_lon,jj_nb) 231 250 232 251 IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',trim(field_name) 233 if ((size(field) .eq. L_NSPECTI) .or. (size(field) .eq. L_NSPECTV)) then 234 !$OMP MASTER 252 if ((size(field) .eq. L_NSPECTI) .or. (size(field) .eq. L_NSPECTV)) then 253 !$OMP MASTER 235 254 ! only for spectral stuff: IR_Bandwidth and VI_Bandwidth 236 255 call xios_send_field(field_name,field) … … 239 258 endif 240 259 IF (SIZE(field)/=klon) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon',1) 241 242 CALL Gather_omp(field,buffer_omp) 260 261 CALL Gather_omp(field,buffer_omp) 243 262 !$OMP MASTER 244 263 CALL grid1Dto2D_mpi(buffer_omp,Field2d) 245 264 246 265 CALL xios_send_field(field_name, Field2d) 247 !$OMP END MASTER 266 !$OMP END MASTER 248 267 249 268 IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite2d_xios ',trim(field_name) … … 281 300 282 301 CALL xios_send_field(field_name, Field3d(:,:,1:nlev)) 283 !$OMP END MASTER 302 !$OMP END MASTER 284 303 285 304 IF (prt_level >= 10) write(lunout,*)'End histrwrite3d_xios ',trim(field_name) -
trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
r3508 r3522 2390 2390 call write_output("w","Vertical wind","m.s-1",pw) 2391 2391 call write_output("p","Pressure","Pa",pplay) 2392 call write_output("omega","omega","Pa/s",omega) 2392 2393 endif 2393 2394 … … 2450 2451 ! call write_output(trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', & 2451 2452 ! 'kg m^-2',qsurf_hist(1,iq) ) 2452 call write_output(trim(noms(iq))//'_col',trim(noms(iq))//'_col', &2453 call write_output(trim(noms(iq))//'_col',trim(noms(iq))//'_col', & 2453 2454 'kg m^-2',qcol(:,iq) ) 2454 2455 call write_output(trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', &
Note: See TracChangeset
for help on using the changeset viewer.