SUBROUTINE physiq( $ ngrid,nlayer,nq $ ,firstcall,lastcall $ ,pday,ptime,ptimestep $ ,pplev,pplay,pphi $ ,pu,pv,pt,pq $ ,pw $ ,pdu,pdv,pdt,pdq,pdpsrf,tracerdyn #ifdef MESOSCALE #include "meso_inc/meso_inc_invar.F" #endif $ ) use tracer_mod, only: noms, mmol, igcm_co2, igcm_n2, & igcm_co, igcm_o, igcm_h2o_vap, igcm_h2o_ice, & igcm_ccn_mass, igcm_ccn_number, & igcm_dust_mass, igcm_dust_number, igcm_h2o2, & nuice_ref, rho_ice, rho_dust, ref_r0 use comsoil_h, only: inertiedat, ! soil thermal inertia & nsoilmx ! number of subsurface layers use eofdump_mod, only: eofdump use comgeomfi_h, only: long, lati, area use comdiurn_h, only: sinlon, coslon, sinlat, coslat use surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, & zthe, z0, albedo_h2o_ice, & frost_albedo_threshold use comsaison_h, only: dist_sol, declin, mu0, fract use slope_mod, only: theta_sl, psi_sl use conc_mod, only: rnew, cpnew, mmean #ifdef MESOSCALE use comsoil_h, only: mlayer,layer use surfdat_h, only: z0_default #endif IMPLICIT NONE c======================================================================= c c subject: c -------- c c Organisation of the physical parametrisations of the LMD c martian atmospheric general circulation model. c c The GCM can be run without or with tracer transport c depending on the value of Logical "tracer" in file "callphys.def" c Tracers may be water vapor, ice OR chemical species OR dust particles c c SEE comments in initracer.F about numbering of tracer species... c c It includes: c c 1. Initialization: c 1.1 First call initializations c 1.2 Initialization for every call to physiq c 1.2.5 Compute mean mass and cp, R and thermal conduction coeff. c 2. Compute radiative transfer tendencies c (longwave and shortwave) for CO2 and aerosols. c 3. Gravity wave and subgrid scale topography drag : c 4. Vertical diffusion (turbulent mixing): c 5. Convective adjustment c 6. Condensation and sublimation of carbon dioxide. c 7. TRACERS : c 7a. water and water ice c 7b. call for photochemistry when tracers are chemical species c 7c. other scheme for tracer (dust) transport (lifting, sedimentation) c 7d. updates (CO2 pressure variations, surface budget) c 8. Contribution to tendencies due to thermosphere c 9. Surface and sub-surface temperature calculations c 10. Write outputs : c - "startfi", "histfi" (if it's time) c - Saving statistics (if "callstats = .true.") c - Dumping eof (if "calleofdump = .true.") c - Output any needed variables in "diagfi" c 11. Diagnostic: mass conservation of tracers c c author: c ------- c Frederic Hourdin 15/10/93 c Francois Forget 1994 c Christophe Hourdin 02/1997 c Subroutine completly rewritten by F.Forget (01/2000) c Introduction of the photochemical module: S. Lebonnois (11/2002) c Introduction of the thermosphere module: M. Angelats i Coll (2002) c Water ice clouds: Franck Montmessin (update 06/2003) c Radiatively active tracers: J.-B. Madeleine (10/2008-06/2009) c Nb: See callradite.F for more information. c Mesoscale lines: Aymeric Spiga (2007 - 2011) -- check MESOSCALE flags c jul 2011 malv+fgg: Modified calls to NIR heating routine and 15 um cooling parameterization c c arguments: c ---------- c c input: c ------ c ecri period (in dynamical timestep) to write output c ngrid Size of the horizontal grid. c All internal loops are performed on that grid. c nlayer Number of vertical layers. c nq Number of advected fields c firstcall True at the first call c lastcall True at the last call c pday Number of days counted from the North. Spring c equinoxe. c ptime Universal time (0 0 ! This is due to single precision rounding problems if (microphys) then pdq(1:ngrid,1:nlayer,igcm_ccn_mass) = & pdq(1:ngrid,1:nlayer,igcm_ccn_mass) + & zdqcloud(1:ngrid,1:nlayer,igcm_ccn_mass) pdq(1:ngrid,1:nlayer,igcm_ccn_number) = & pdq(1:ngrid,1:nlayer,igcm_ccn_number) + & zdqcloud(1:ngrid,1:nlayer,igcm_ccn_number) where (pq(:,:,igcm_ccn_mass) + & ptimestep*pdq(:,:,igcm_ccn_mass) < 0.) pdq(:,:,igcm_ccn_mass) = & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 pdq(:,:,igcm_ccn_number) = & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 end where where (pq(:,:,igcm_ccn_number) + & ptimestep*pdq(:,:,igcm_ccn_number) < 0.) pdq(:,:,igcm_ccn_mass) = & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 pdq(:,:,igcm_ccn_number) = & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 end where endif if (scavenging) then pdq(1:ngrid,1:nlayer,igcm_dust_mass) = & pdq(1:ngrid,1:nlayer,igcm_dust_mass) + & zdqcloud(1:ngrid,1:nlayer,igcm_dust_mass) pdq(1:ngrid,1:nlayer,igcm_dust_number) = & pdq(1:ngrid,1:nlayer,igcm_dust_number) + & zdqcloud(1:ngrid,1:nlayer,igcm_dust_number) where (pq(:,:,igcm_dust_mass) + & ptimestep*pdq(:,:,igcm_dust_mass) < 0.) pdq(:,:,igcm_dust_mass) = & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 pdq(:,:,igcm_dust_number) = & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 end where where (pq(:,:,igcm_dust_number) + & ptimestep*pdq(:,:,igcm_dust_number) < 0.) pdq(:,:,igcm_dust_mass) = & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 pdq(:,:,igcm_dust_number) = & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 end where endif ! of if scavenging END IF ! of IF (water) c 6b. Aerosol particles c ------------------- c ---------- c Dust devil : c ---------- IF(callddevil) then call dustdevil(ngrid,nlayer,nq, zplev,pu,pv,pt, tsurf,q2, & zdqdev,zdqsdev) if (dustbin.ge.1) then do iq=1,nq DO l=1,nlayer DO ig=1,ngrid pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqdev(ig,l,iq) ENDDO ENDDO enddo do iq=1,nq DO ig=1,ngrid dqsurf(ig,iq)= dqsurf(ig,iq) + zdqsdev(ig,iq) ENDDO enddo endif ! of if (dustbin.ge.1) END IF ! of IF (callddevil) c ------------- c Sedimentation : acts also on water ice c ------------- IF (sedimentation) THEN !call zerophys(ngrid*nlayer*nq, zdqsed) zdqsed(1:ngrid,1:nlayer,1:nq)=0 !call zerophys(ngrid*nq, zdqssed) zdqssed(1:ngrid,1:nq)=0 call callsedim(ngrid,nlayer, ptimestep, & zplev,zzlev, zzlay, pt, pdt, rdust, rice, & rsedcloud,rhocloud, & pq, pdq, zdqsed, zdqssed,nq, & tau,tauscaling) DO iq=1, nq DO l=1,nlayer DO ig=1,ngrid pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqsed(ig,l,iq) ENDDO ENDDO ENDDO DO iq=1, nq DO ig=1,ngrid dqsurf(ig,iq)= dqsurf(ig,iq) + zdqssed(ig,iq) ENDDO ENDDO END IF ! of IF (sedimentation) c Add lifted dust to tendancies after sedimentation in the LES #ifdef MESOSCALE #include "meso_inc/meso_inc_lift_les.F" #endif c c 6c. Chemical species c ------------------ #ifndef MESOSCALE c -------------- c photochemistry : c -------------- IF (photochem .or. thermochem) then ! dust and ice surface area call surfacearea(ngrid, nlayer, ptimestep, zplay, zzlay, $ pt, pq, pdq, nq, $ rdust, rice, tau, tauscaling, $ surfdust, surfice) ! call photochemistry call calchim(ngrid,nlayer,nq, & ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0, $ zzlev,zzlay,zday,pq,pdq,zdqchim,zdqschim, $ zdqcloud,zdqscloud,tauref,co2ice, $ pu,pdu,pv,pdv,surfdust,surfice) ! increment values of tracers: DO iq=1,nq ! loop on all tracers; tendencies for non-chemistry ! tracers is zero anyways DO l=1,nlayer DO ig=1,ngrid pdq(ig,l,iq)=pdq(ig,l,iq)+zdqchim(ig,l,iq) ENDDO ENDDO ENDDO ! of DO iq=1,nq ! add condensation tendency for H2O2 if (igcm_h2o2.ne.0) then DO l=1,nlayer DO ig=1,ngrid pdq(ig,l,igcm_h2o2)=pdq(ig,l,igcm_h2o2) & +zdqcloud(ig,l,igcm_h2o2) ENDDO ENDDO endif ! increment surface values of tracers: DO iq=1,nq ! loop on all tracers; tendencies for non-chemistry ! tracers is zero anyways DO ig=1,ngrid dqsurf(ig,iq)=dqsurf(ig,iq)+zdqschim(ig,iq) ENDDO ENDDO ! of DO iq=1,nq ! add condensation tendency for H2O2 if (igcm_h2o2.ne.0) then DO ig=1,ngrid dqsurf(ig,igcm_h2o2)=dqsurf(ig,igcm_h2o2) & +zdqscloud(ig,igcm_h2o2) ENDDO endif END IF ! of IF (photochem.or.thermochem) #endif c 6d. Updates c --------- DO iq=1, nq DO ig=1,ngrid c --------------------------------- c Updating tracer budget on surface c --------------------------------- qsurf(ig,iq)=qsurf(ig,iq)+ptimestep*dqsurf(ig,iq) ENDDO ! (ig) ENDDO ! (iq) endif ! of if (tracer) #ifndef MESOSCALE c----------------------------------------------------------------------- c 7. THERMOSPHERE CALCULATION c----------------------------------------------------------------------- if (callthermos) then call thermosphere(ngrid,nlayer,nq,zplev,zplay,dist_sol, $ mu0,ptimestep,ptime,zday,tsurf,zzlev,zzlay, & pt,pq,pu,pv,pdt,pdq, $ zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff) DO l=1,nlayer DO ig=1,ngrid dtrad(ig,l)=dtrad(ig,l)+zdteuv(ig,l) pdt(ig,l)=pdt(ig,l)+zdtconduc(ig,l) & +zdteuv(ig,l) pdv(ig,l)=pdv(ig,l)+zdvmolvis(ig,l) pdu(ig,l)=pdu(ig,l)+zdumolvis(ig,l) DO iq=1, nq pdq(ig,l,iq)=pdq(ig,l,iq)+zdqmoldiff(ig,l,iq) ENDDO ENDDO ENDDO endif ! of if (callthermos) #endif c----------------------------------------------------------------------- c 8. Carbon dioxide condensation-sublimation: c (should be the last atmospherical physical process to be computed) c ------------------------------------------- IF (tituscap) THEN !!! get the actual co2 seasonal cap from Titus observations CALL geticecover( ngrid, 180.*zls/pi, . 180.*long/pi, 180.*lati/pi, co2ice ) co2ice = co2ice * 10000. ENDIF pdpsrf(:) = 0 IF (callcond) THEN CALL newcondens(ngrid,nlayer,nq,ptimestep, $ capcal,zplay,zplev,tsurf,pt, $ pphi,pdt,pdu,pdv,zdtsurf,pu,pv,pq,pdq, $ co2ice,albedo,emis, $ zdtc,zdtsurfc,pdpsrf,zduc,zdvc,zdqc, $ fluxsurf_sw,zls) DO l=1,nlayer DO ig=1,ngrid pdt(ig,l)=pdt(ig,l)+zdtc(ig,l) pdv(ig,l)=pdv(ig,l)+zdvc(ig,l) pdu(ig,l)=pdu(ig,l)+zduc(ig,l) ENDDO ENDDO DO ig=1,ngrid zdtsurf(ig) = zdtsurf(ig) + zdtsurfc(ig) ENDDO IF (tracer) THEN DO iq=1, nq DO l=1,nlayer DO ig=1,ngrid pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqc(ig,l,iq) ENDDO ENDDO ENDDO ENDIF ! of IF (tracer) #ifndef MESOSCALE ! update surface pressure DO ig=1,ngrid ps(ig) = zplev(ig,1) + pdpsrf(ig)*ptimestep ENDDO ! update pressure levels DO l=1,nlayer DO ig=1,ngrid zplay(ig,l) = aps(l) + bps(l)*ps(ig) zplev(ig,l) = ap(l) + bp(l)*ps(ig) ENDDO ENDDO zplev(:,nlayer+1) = 0. ! update layers altitude DO l=2,nlayer DO ig=1,ngrid z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l)) zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2) ENDDO ENDDO #endif ENDIF ! of IF (callcond) c----------------------------------------------------------------------- c 9. Surface and sub-surface soil temperature c----------------------------------------------------------------------- c c c 9.1 Increment Surface temperature: c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DO ig=1,ngrid tsurf(ig)=tsurf(ig)+ptimestep*zdtsurf(ig) ENDDO c Prescribe a cold trap at south pole (except at high obliquity !!) c Temperature at the surface is set there to be the temperature c corresponding to equilibrium temperature between phases of CO2 IF (tracer.AND.water.AND.(ngrid.NE.1)) THEN !#ifndef MESOSCALE ! if (caps.and.(obliquit.lt.27.)) then => now done in newcondens ! NB: Updated surface pressure, at grid point 'ngrid', is ! ps(ngrid)=zplev(ngrid,1)+pdpsrf(ngrid)*ptimestep ! tsurf(ngrid)=1./(1./136.27-r/5.9e+5*alog(0.0095* ! & (zplev(ngrid,1)+pdpsrf(ngrid)*ptimestep))) ! tsurf(ngrid)=1./(1./136.27-r/5.9e+5*alog(0.0095*ps(ngrid))) ! endif !#endif c ------------------------------------------------------------- c Change of surface albedo in case of ground frost c everywhere except on the north permanent cap and in regions c covered by dry ice. c ALWAYS PLACE these lines after newcondens !!! c ------------------------------------------------------------- do ig=1,ngrid if ((co2ice(ig).eq.0).and. & (qsurf(ig,igcm_h2o_ice).gt.frost_albedo_threshold)) then albedo(ig,1) = albedo_h2o_ice albedo(ig,2) = albedo_h2o_ice c write(*,*) "frost thickness", qsurf(ig,igcm_h2o_ice) c write(*,*) "physiq.F frost :" c & ,lati(ig)*180./pi, long(ig)*180./pi endif enddo ! of do ig=1,ngrid ENDIF ! of IF (tracer.AND.water.AND.(ngrid.NE.1)) c c 9.2 Compute soil temperatures and subsurface heat flux: c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IF (callsoil) THEN c Thermal inertia feedback IF (tifeedback) THEN CALL soil_tifeedback(ngrid,nsoilmx,qsurf,inertiesoil) CALL soil(ngrid,nsoilmx,.false.,inertiesoil, s ptimestep,tsurf,tsoil,capcal,fluxgrd) ELSE CALL soil(ngrid,nsoilmx,.false.,inertiedat, s ptimestep,tsurf,tsoil,capcal,fluxgrd) ENDIF ENDIF c----------------------------------------------------------------------- c 10. Write output files c ---------------------- c Save variables for eventual restart in MMM and LES #ifdef MESOSCALE #include "meso_inc/meso_inc_save_restart.F" #endif c ------------------------------- c Dynamical fields incrementation c ------------------------------- c (FOR OUTPUT ONLY : the actual model integration is performed in the dynamics) ! temperature, zonal and meridional wind DO l=1,nlayer DO ig=1,ngrid zt(ig,l)=pt(ig,l) + pdt(ig,l)*ptimestep zu(ig,l)=pu(ig,l) + pdu(ig,l)*ptimestep zv(ig,l)=pv(ig,l) + pdv(ig,l)*ptimestep ENDDO ENDDO ! tracers DO iq=1, nq DO l=1,nlayer DO ig=1,ngrid zq(ig,l,iq)=pq(ig,l,iq) +pdq(ig,l,iq)*ptimestep ENDDO ENDDO ENDDO ! Density DO l=1,nlayer DO ig=1,ngrid rho(ig,l) = zplay(ig,l)/(rnew(ig,l)*zt(ig,l)) ENDDO ENDDO ! Potential Temperature DO ig=1,ngrid DO l=1,nlayer zh(ig,l) = zt(ig,l)*(zplev(ig,1)/zplay(ig,l))**rcp ENDDO ENDDO c Compute surface stress : (NB: z0 is a common in surfdat.h) c DO ig=1,ngrid c cd = (0.4/log(zzlay(ig,1)/z0(ig)))**2 c zstress(ig) = rho(ig,1)*cd*(zu(ig,1)**2 + zv(ig,1)**2) c ENDDO c Sum of fluxes in solar spectral bands (for output only) DO ig=1,ngrid fluxtop_sw_tot(ig)=fluxtop_sw(ig,1) + fluxtop_sw(ig,2) fluxsurf_sw_tot(ig)=fluxsurf_sw(ig,1) + fluxsurf_sw(ig,2) ENDDO c ******* TEST ****************************************************** ztim1 = 999 DO l=1,nlayer DO ig=1,ngrid if (pt(ig,l).lt.ztim1) then ztim1 = pt(ig,l) igmin = ig lmin = l end if ENDDO ENDDO if(min(pt(igmin,lmin),zt(igmin,lmin)).lt.70.) then write(*,*) 'PHYSIQ: stability WARNING :' write(*,*) 'pt, zt Tmin = ', pt(igmin,lmin), zt(igmin,lmin), & 'ig l =', igmin, lmin end if c ******************************************************************* c --------------------- c Outputs to the screen c --------------------- IF (lwrite) THEN PRINT*,'Global diagnostics for the physics' PRINT*,'Variables and their increments x and dx/dt * dt' WRITE(*,'(a6,a10,2a15)') 'Ts','dTs','ps','dps' WRITE(*,'(2f10.5,2f15.5)') s tsurf(igout),zdtsurf(igout)*ptimestep, s zplev(igout,1),pdpsrf(igout)*ptimestep WRITE(*,'(a4,a6,5a10)') 'l','u','du','v','dv','T','dT' WRITE(*,'(i4,6f10.5)') (l, s pu(igout,l),pdu(igout,l)*ptimestep, s pv(igout,l),pdv(igout,l)*ptimestep, s pt(igout,l),pdt(igout,l)*ptimestep, s l=1,nlayer) ENDIF ! of IF (lwrite) c ---------------------------------------------------------- c ---------------------------------------------------------- c INTERPOLATIONS IN THE SURFACE-LAYER c ---------------------------------------------------------- c ---------------------------------------------------------- n_out=0 ! number of elements in the z_out array. ! for z_out=[3.,2.,1.,0.5,0.1], n_out must be set ! to 5 IF (n_out .ne. 0) THEN IF(.NOT. ALLOCATED(z_out)) ALLOCATE(z_out(n_out)) IF(.NOT. ALLOCATED(T_out)) ALLOCATE(T_out(ngrid,n_out)) IF(.NOT. ALLOCATED(u_out)) ALLOCATE(u_out(ngrid,n_out)) z_out(:)=[3.,2.,1.,0.5,0.1] u_out(:,:)=0. T_out(:,:)=0. call pbl_parameters(ngrid,nlayer,ps,zplay,z0, & g,zzlay,zzlev,zu,zv,wstar,hfmax_th,zmax_th,tsurf,zh,z_out,n_out, & T_out,u_out,ustar,tstar,L_mo,vhf,vvv) #ifndef MESOSCALE IF (ngrid .eq. 1) THEN dimout=0 ELSE dimout=2 ENDIF DO n=1,n_out write(zstring, '(F8.6)') z_out(n) call WRITEDIAGFI(ngrid,'T_out_'//trim(zstring), & 'potential temperature at z_out','K',dimout,T_out(:,n)) call WRITEDIAGFI(ngrid,'u_out_'//trim(zstring), & 'horizontal velocity norm at z_out','m/s',dimout,u_out(:,n)) ENDDO call WRITEDIAGFI(ngrid,'u_star', & 'friction velocity','m/s',dimout,ustar) call WRITEDIAGFI(ngrid,'teta_star', & 'friction potential temperature','K',dimout,tstar) call WRITEDIAGFI(ngrid,'L', & 'Monin Obukhov length','m',dimout,L_mo) call WRITEDIAGFI(ngrid,'vvv', & 'Vertical velocity variance at zout','m',dimout,vvv) call WRITEDIAGFI(ngrid,'vhf', & 'Vertical heat flux at zout','m',dimout,vhf) #else T_out1(:)=T_out(:,1) u_out1(:)=u_out(:,1) #endif ENDIF c ---------------------------------------------------------- c ---------------------------------------------------------- c END OF SURFACE LAYER INTERPOLATIONS c ---------------------------------------------------------- c ---------------------------------------------------------- IF (ngrid.NE.1) THEN #ifndef MESOSCALE c ------------------------------------------------------------------- c Writing NetCDF file "RESTARTFI" at the end of the run c ------------------------------------------------------------------- c Note: 'restartfi' is stored just before dynamics are stored c in 'restart'. Between now and the writting of 'restart', c there will have been the itau=itau+1 instruction and c a reset of 'time' (lastacll = .true. when itau+1= itaufin) c thus we store for time=time+dtvr IF( ((ecritstart.GT.0) .and. . (MOD(icount*iphysiq,ecritstart).EQ.0)) . .or. lastcall ) THEN ztime_fin = pday + ptime + ptimestep/(float(iphysiq)*daysec) . - day_ini - time_phys print*, pday,ptime,day_ini, time_phys write(*,'(A,I7,A,F12.5)') . 'PHYSIQ: Ecriture du fichier restartfi ; icount=', . icount,' date=',ztime_fin call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, . ptimestep,ztime_fin, . tsurf,tsoil,co2ice,emis,q2,qsurf) ENDIF #endif c ------------------------------------------------------------------- c Calculation of diagnostic variables written in both stats and c diagfi files c ------------------------------------------------------------------- if (tracer) then if(doubleq) then do ig=1,ngrid dqdustsurf(ig) = & zdqssed(ig,igcm_dust_mass)*tauscaling(ig) dndustsurf(ig) = & zdqssed(ig,igcm_dust_number)*tauscaling(ig) ndust(ig,:) = & pq(ig,:,igcm_dust_number)*tauscaling(ig) qdust(ig,:) = & pq(ig,:,igcm_dust_mass)*tauscaling(ig) enddo if (scavenging) then do ig=1,ngrid dqdustsurf(ig) = dqdustsurf(ig) + & zdqssed(ig,igcm_ccn_mass)*tauscaling(ig) dndustsurf(ig) = dndustsurf(ig) + & zdqssed(ig,igcm_ccn_number)*tauscaling(ig) nccn(ig,:) = & pq(ig,:,igcm_ccn_number)*tauscaling(ig) qccn(ig,:) = & pq(ig,:,igcm_ccn_mass)*tauscaling(ig) enddo endif endif if (water) then mtot(:)=0 icetot(:)=0 rave(:)=0 tauTES(:)=0 do ig=1,ngrid do l=1,nlayer mtot(ig) = mtot(ig) + & zq(ig,l,igcm_h2o_vap) * & (zplev(ig,l) - zplev(ig,l+1)) / g icetot(ig) = icetot(ig) + & zq(ig,l,igcm_h2o_ice) * & (zplev(ig,l) - zplev(ig,l+1)) / g c Computing abs optical depth at 825 cm-1 in each c layer to simulate NEW TES retrieval Qabsice = min( & max(0.4e6*rice(ig,l)*(1.+nuice_ref)-0.05 ,0.),1.2 & ) opTES(ig,l)= 0.75 * Qabsice * & zq(ig,l,igcm_h2o_ice) * & (zplev(ig,l) - zplev(ig,l+1)) / g & / (rho_ice * rice(ig,l) * (1.+nuice_ref)) tauTES(ig)=tauTES(ig)+ opTES(ig,l) enddo c rave(ig)=rave(ig)/max(icetot(ig),1.e-30) ! mass weight c if (icetot(ig)*1e3.lt.0.01) rave(ig)=0. enddo call watersat(ngrid*nlayer,zt,zplay,zqsat) satu(:,:) = zq(:,:,igcm_h2o_vap)/zqsat(:,:) if (scavenging) then Nccntot(:)= 0 Mccntot(:)= 0 rave(:)=0 do ig=1,ngrid do l=1,nlayer Nccntot(ig) = Nccntot(ig) + & zq(ig,l,igcm_ccn_number)*tauscaling(ig) & *(zplev(ig,l) - zplev(ig,l+1)) / g Mccntot(ig) = Mccntot(ig) + & zq(ig,l,igcm_ccn_mass)*tauscaling(ig) & *(zplev(ig,l) - zplev(ig,l+1)) / g cccc Column integrated effective ice radius cccc is weighted by total ice surface area (BETTER than total ice mass) rave(ig) = rave(ig) + & tauscaling(ig) * & zq(ig,l,igcm_ccn_number) * & (zplev(ig,l) - zplev(ig,l+1)) / g * & rice(ig,l) * rice(ig,l)* (1.+nuice_ref) enddo rave(ig)=(icetot(ig)/rho_ice+Mccntot(ig)/rho_dust)*0.75 & /max(pi*rave(ig),1.e-30) ! surface weight if (icetot(ig)*1e3.lt.0.01) rave(ig)=0. enddo else ! of if (scavenging) rave(:)=0 do ig=1,ngrid do l=1,nlayer rave(ig) = rave(ig) + & zq(ig,l,igcm_h2o_ice) * & (zplev(ig,l) - zplev(ig,l+1)) / g * & rice(ig,l) * (1.+nuice_ref) enddo rave(ig) = max(rave(ig) / & max(icetot(ig),1.e-30),1.e-30) ! mass weight enddo endif ! of if (scavenging) endif ! of if (water) endif ! of if (tracer) c ----------------------------------------------------------------- c WSTATS: Saving statistics c ----------------------------------------------------------------- c ("stats" stores and accumulates 8 key variables in file "stats.nc" c which can later be used to make the statistic files of the run: c "stats") only possible in 3D runs ! IF (callstats) THEN call wstats(ngrid,"ps","Surface pressure","Pa",2,ps) call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf) call wstats(ngrid,"co2ice","CO2 ice cover", & "kg.m-2",2,co2ice) call wstats(ngrid,"tauref","reference dod at 610 Pa","NU", & 2,tauref) call wstats(ngrid,"fluxsurf_lw", & "Thermal IR radiative flux to surface","W.m-2",2, & fluxsurf_lw) call wstats(ngrid,"fluxsurf_sw", & "Solar radiative flux to surface","W.m-2",2, & fluxsurf_sw_tot) call wstats(ngrid,"fluxtop_lw", & "Thermal IR radiative flux to space","W.m-2",2, & fluxtop_lw) call wstats(ngrid,"fluxtop_sw", & "Solar radiative flux to space","W.m-2",2, & fluxtop_sw_tot) call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt) call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu) call wstats(ngrid,"v","Meridional (North-South) wind", & "m.s-1",3,zv) call wstats(ngrid,"w","Vertical (down-up) wind", & "m.s-1",3,pw) call wstats(ngrid,"rho","Atmospheric density","kg/m3",3,rho) call wstats(ngrid,"pressure","Pressure","Pa",3,zplay) call wstats(ngrid,"q2", & "Boundary layer eddy kinetic energy", & "m2.s-2",3,q2) call wstats(ngrid,"emis","Surface emissivity","w.m-1",2, & emis) c call wstats(ngrid,"ssurf","Surface stress","N.m-2", c & 2,zstress) c call wstats(ngrid,"sw_htrt","sw heat.rate", c & "W.m-2",3,zdtsw) c call wstats(ngrid,"lw_htrt","lw heat.rate", c & "W.m-2",3,zdtlw) if (calltherm) then call wstats(ngrid,"zmax_th","Height of thermals", & "m",2,zmax_th) call wstats(ngrid,"hfmax_th","Max thermals heat flux", & "K.m/s",2,hfmax_th) call wstats(ngrid,"wstar", & "Max vertical velocity in thermals", & "m/s",2,wstar) endif if (tracer) then if (water) then vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap) & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) call wstats(ngrid,"vmr_h2ovap", & "H2O vapor volume mixing ratio","mol/mol", & 3,vmr) vmr=zq(1:ngrid,1:nlayer,igcm_h2o_ice) & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_ice) call wstats(ngrid,"vmr_h2oice", & "H2O ice volume mixing ratio","mol/mol", & 3,vmr) vmr=zqsat(1:ngrid,1:nlayer) & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) call wstats(ngrid,"vmr_h2osat", & "saturation volume mixing ratio","mol/mol", & 3,vmr) call wstats(ngrid,"h2o_ice_s", & "surface h2o_ice","kg/m2", & 2,qsurf(1,igcm_h2o_ice)) call wstats(ngrid,'albedo', & 'albedo', & '',2,albedo(1,1)) call wstats(ngrid,"mtot", & "total mass of water vapor","kg/m2", & 2,mtot) call wstats(ngrid,"icetot", & "total mass of water ice","kg/m2", & 2,icetot) call wstats(ngrid,"reffice", & "Mean reff","m", & 2,rave) call wstats(ngrid,"Nccntot", & "condensation nuclei","Nbr/m2", & 2,Nccntot) call wstats(ngrid,"Mccntot", & "condensation nuclei mass","kg/m2", & 2,Mccntot) call wstats(ngrid,"rice", & "Ice particle size","m", & 3,rice) if (.not.activice) then call wstats(ngrid,"tauTESap", & "tau abs 825 cm-1","", & 2,tauTES) else call wstats(ngrid,'tauTES', & 'tau abs 825 cm-1', & '',2,taucloudtes) endif endif ! of if (water) if (dustbin.ne.0) then call wstats(ngrid,'tau','taudust','SI',2,tau(1,1)) if (doubleq) then c call wstats(ngrid,'qsurf','qsurf', c & 'kg.m-2',2,qsurf(1,igcm_dust_mass)) c call wstats(ngrid,'Nsurf','N particles', c & 'N.m-2',2,qsurf(1,igcm_dust_number)) c call wstats(ngrid,'dqsdev','ddevil lift', c & 'kg.m-2.s-1',2,zdqsdev(1,1)) c call wstats(ngrid,'dqssed','sedimentation', c & 'kg.m-2.s-1',2,zdqssed(1,1)) c call wstats(ngrid,'dqsdif','diffusion', c & 'kg.m-2.s-1',2,zdqsdif(1,1)) call wstats(ngrid,'dqsdust', & 'deposited surface dust mass', & 'kg.m-2.s-1',2,dqdustsurf) call wstats(ngrid,'dqndust', & 'deposited surface dust number', & 'number.m-2.s-1',2,dndustsurf) call wstats(ngrid,'reffdust','reffdust', & 'm',3,rdust*ref_r0) call wstats(ngrid,'dustq','Dust mass mr', & 'kg/kg',3,qdust) call wstats(ngrid,'dustN','Dust number', & 'part/kg',3,ndust) else do iq=1,dustbin write(str2(1:2),'(i2.2)') iq call wstats(ngrid,'q'//str2,'mix. ratio', & 'kg/kg',3,zq(1,1,iq)) call wstats(ngrid,'qsurf'//str2,'qsurf', & 'kg.m-2',2,qsurf(1,iq)) end do endif ! (doubleq) if (scavenging) then call wstats(ngrid,'ccnq','CCN mass mr', & 'kg/kg',3,qccn) call wstats(ngrid,'ccnN','CCN number', & 'part/kg',3,nccn) endif ! (scavenging) endif ! (dustbin.ne.0) if (thermochem.or.photochem) then do iq=1,nq if (noms(iq) .ne. "dust_mass" .and. $ noms(iq) .ne. "dust_number" .and. $ noms(iq) .ne. "ccn_mass" .and. $ noms(iq) .ne. "ccn_number" .and. $ noms(iq) .ne. "h2o_vap" .and. $ noms(iq) .ne. "h2o_ice") then vmr(1:ngrid,1:nlayer)=zq(1:ngrid,1:nlayer,iq) & *mmean(1:ngrid,1:nlayer)/mmol(iq) rhopart(1:ngrid,1:nlayer)=zq(1:ngrid,1:nlayer,iq) & *rho(1:ngrid,1:nlayer)*n_avog/ & (1000*mmol(iq)) call wstats(ngrid,"vmr_"//trim(noms(iq)), $ "Volume mixing ratio","mol/mol",3,vmr) ! call wstats(ngrid,"rho_"//trim(noms(iq)), ! $ "Number density","cm-3",3,rhopart) ! call writediagfi(ngrid,"rho_"//trim(noms(iq)), ! $ "Number density","cm-3",3,rhopart) if ((noms(iq).eq."o") .or. (noms(iq).eq."co2").or. $ (noms(iq).eq."o3")) then call writediagfi(ngrid,"vmr_"//trim(noms(iq)), $ "Volume mixing ratio","mol/mol",3,vmr) end if do ig = 1,ngrid colden(ig,iq) = 0. end do do l=1,nlayer do ig=1,ngrid colden(ig,iq) = colden(ig,iq) + zq(ig,l,iq) $ *(zplev(ig,l)-zplev(ig,l+1)) $ *6.022e22/(mmol(iq)*g) end do end do call wstats(ngrid,"c_"//trim(noms(iq)), $ "column","mol cm-2",2,colden(1,iq)) call writediagfi(ngrid,"c_"//trim(noms(iq)), $ "column","mol cm-2",2,colden(1,iq)) end if ! of if (noms(iq) .ne. "dust_mass" ...) end do ! of do iq=1,nq end if ! of if (thermochem.or.photochem) end if ! of if (tracer) IF(lastcall) THEN write (*,*) "Writing stats..." call mkstats(ierr) ENDIF ENDIF !if callstats c (Store EOF for Mars Climate database software) IF (calleofdump) THEN CALL eofdump(ngrid, nlayer, zu, zv, zt, rho, ps) ENDIF #ifdef MESOSCALE !!! !!! OUTPUT FIELDS !!! wtsurf(1:ngrid) = tsurf(1:ngrid) !! surface temperature wco2ice(1:ngrid) = co2ice(1:ngrid) !! co2 ice TAU_lay(:)=tau(:,1)!!true opacity (not a reference like tauref) IF (tracer) THEN mtot(1:ngrid) = mtot(1:ngrid) * 1.e6 / rho_ice icetot(1:ngrid) = icetot(1:ngrid) * 1.e6 / rho_ice !! JF IF (igcm_dust_mass .ne. 0) THEN qsurfdust(1:ngrid) = qsurf(1:ngrid,igcm_dust_mass) ENDIF IF (igcm_h2o_ice .ne. 0) THEN qsurfice(1:ngrid) = qsurf(1:ngrid,igcm_h2o_ice) vmr=1.e6 * zq(1:ngrid,1:nlayer,igcm_h2o_ice) . *mmean(1:ngrid,1:nlayer) / mmol(igcm_h2o_ice) ENDIF !! Dust quantity integration along the vertical axe dustot(:)=0 IF (igcm_dust_mass .ne. 0) THEN do ig=1,ngrid do l=1,nlayer dustot(ig) = dustot(ig) + & zq(ig,l,igcm_dust_mass) & * (zplev(ig,l) - zplev(ig,l+1)) / g enddo enddo ENDIF ENDIF !! TAU water ice as seen by TES if (activice) tauTES = taucloudtes c AUTOMATICALLY GENERATED FROM REGISTRY #include "fill_save.inc" #else #ifndef MESOINI c ========================================================== c WRITEDIAGFI: Outputs in netcdf file "DIAGFI", containing c any variable for diagnostic (output with period c "ecritphy", set in "run.def") c ========================================================== c WRITEDIAGFI can ALSO be called from any other subroutines c for any variables !! c call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2, c & emis) c call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay) c call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev) call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",2, & tsurf) call WRITEDIAGFI(ngrid,"ps","surface pressure","Pa",2,ps) call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness" & ,"kg.m-2",2,co2ice) call WRITEDIAGFI(ngrid,"temp7","temperature in layer 7", & "K",2,zt(1,7)) call WRITEDIAGFI(ngrid,"fluxsurf_lw","fluxsurf_lw","W.m-2",2, & fluxsurf_lw) call WRITEDIAGFI(ngrid,"fluxsurf_sw","fluxsurf_sw","W.m-2",2, & fluxsurf_sw_tot) call WRITEDIAGFI(ngrid,"fluxtop_lw","fluxtop_lw","W.m-2",2, & fluxtop_lw) call WRITEDIAGFI(ngrid,"fluxtop_sw","fluxtop_sw","W.m-2",2, & fluxtop_sw_tot) call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt) call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu) call WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv) call WRITEDIAGFI(ngrid,"w","Vertical wind","m.s-1",3,pw) call WRITEDIAGFI(ngrid,"rho","density","none",3,rho) c call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",3,q2) c call WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh) call WRITEDIAGFI(ngrid,"pressure","Pressure","Pa",3,zplay) c call WRITEDIAGFI(ngrid,"ssurf","Surface stress","N.m-2",2, c & zstress) c call WRITEDIAGFI(ngrid,'sw_htrt','sw heat. rate', c & 'w.m-2',3,zdtsw) c call WRITEDIAGFI(ngrid,'lw_htrt','lw heat. rate', c & 'w.m-2',3,zdtlw) if (.not.activice) then CALL WRITEDIAGFI(ngrid,'tauTESap', & 'tau abs 825 cm-1', & '',2,tauTES) else CALL WRITEDIAGFI(ngrid,'tauTES', & 'tau abs 825 cm-1', & '',2,taucloudtes) endif #else !!! this is to ensure correct initialisation of mesoscale model call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",2, & tsurf) call WRITEDIAGFI(ngrid,"ps","surface pressure","Pa",2,ps) call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness","kg.m-2",2, & co2ice) call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt) call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu) call WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv) call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2, & emis) call WRITEDIAGFI(ngrid,"tsoil","Soil temperature", & "K",3,tsoil) call WRITEDIAGFI(ngrid,"inertiedat","Soil inertia", & "K",3,inertiedat) #endif c ---------------------------------------------------------- c Outputs of the CO2 cycle c ---------------------------------------------------------- if (tracer.and.(igcm_co2.ne.0)) then ! call WRITEDIAGFI(ngrid,"co2_l1","co2 mix. ratio in 1st layer", ! & "kg/kg",2,zq(1,1,igcm_co2)) call WRITEDIAGFI(ngrid,"co2","co2 mass mixing ratio", & "kg/kg",3,zq(1,1,igcm_co2)) ! Compute co2 column co2col(:)=0 do l=1,nlayer do ig=1,ngrid co2col(ig)=co2col(ig)+ & zq(ig,l,igcm_co2)*(zplev(ig,l)-zplev(ig,l+1))/g enddo enddo call WRITEDIAGFI(ngrid,"co2col","CO2 column","kg.m-2",2, & co2col) endif ! of if (tracer.and.(igcm_co2.ne.0)) c ---------------------------------------------------------- c Outputs of the water cycle c ---------------------------------------------------------- if (tracer) then if (water) then #ifdef MESOINI !!!! waterice = q01, voir readmeteo.F90 call WRITEDIAGFI(ngrid,'q01',noms(igcm_h2o_ice), & 'kg/kg',3, & zq(1:ngrid,1:nlayer,igcm_h2o_ice)) !!!! watervapor = q02, voir readmeteo.F90 call WRITEDIAGFI(ngrid,'q02',noms(igcm_h2o_vap), & 'kg/kg',3, & zq(1:ngrid,1:nlayer,igcm_h2o_vap)) !!!! surface waterice qsurf02 (voir readmeteo) call WRITEDIAGFI(ngrid,'qsurf02','surface tracer', & 'kg.m-2',2, & qsurf(1:ngrid,igcm_h2o_ice)) #endif CALL WRITEDIAGFI(ngrid,'mtot', & 'total mass of water vapor', & 'kg/m2',2,mtot) CALL WRITEDIAGFI(ngrid,'icetot', & 'total mass of water ice', & 'kg/m2',2,icetot) vmr=zq(1:ngrid,1:nlayer,igcm_h2o_ice) & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_ice) call WRITEDIAGFI(ngrid,'vmr_h2oice','h2o ice vmr', & 'mol/mol',3,vmr) vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap) & *mmean(1:ngrid,1:nlayer)/mmol(igcm_h2o_vap) call WRITEDIAGFI(ngrid,'vmr_h2ovap','h2o vap vmr', & 'mol/mol',3,vmr) CALL WRITEDIAGFI(ngrid,'reffice', & 'Mean reff', & 'm',2,rave) CALL WRITEDIAGFI(ngrid,"Nccntot", & "condensation nuclei","Nbr/m2", & 2,Nccntot) CALL WRITEDIAGFI(ngrid,"Mccntot", & "mass condensation nuclei","kg/m2", & 2,Mccntot) call WRITEDIAGFI(ngrid,'rice','Ice particle size', & 'm',3,rice) call WRITEDIAGFI(ngrid,'h2o_ice_s', & 'surface h2o_ice', & 'kg.m-2',2,qsurf(1,igcm_h2o_ice)) CALL WRITEDIAGFI(ngrid,'albedo', & 'albedo', & '',2,albedo(1,1)) if (tifeedback) then call WRITEDIAGSOIL(ngrid,"soiltemp", & "Soil temperature","K", & 3,tsoil) call WRITEDIAGSOIL(ngrid,'soilti', & 'Soil Thermal Inertia', & 'J.s-1/2.m-2.K-1',3,inertiesoil) endif endif !(water) if (water.and..not.photochem) then iq=nq c write(str2(1:2),'(i2.2)') iq c call WRITEDIAGFI(ngrid,'dqs'//str2,'dqscloud', c & 'kg.m-2',2,zdqscloud(1,iq)) c call WRITEDIAGFI(ngrid,'dqch'//str2,'var chim', c & 'kg/kg',3,zdqchim(1,1,iq)) c call WRITEDIAGFI(ngrid,'dqd'//str2,'var dif', c & 'kg/kg',3,zdqdif(1,1,iq)) c call WRITEDIAGFI(ngrid,'dqa'//str2,'var adj', c & 'kg/kg',3,zdqadj(1,1,iq)) c call WRITEDIAGFI(ngrid,'dqc'//str2,'var c', c & 'kg/kg',3,zdqc(1,1,iq)) endif !(water.and..not.photochem) endif c ---------------------------------------------------------- c Outputs of the dust cycle c ---------------------------------------------------------- call WRITEDIAGFI(ngrid,'tauref', & 'Dust ref opt depth','NU',2,tauref) if (tracer.and.(dustbin.ne.0)) then call WRITEDIAGFI(ngrid,'tau','taudust','SI',2,tau(1,1)) if (doubleq) then c call WRITEDIAGFI(ngrid,'qsurf','qsurf', c & 'kg.m-2',2,qsurf(1,igcm_dust_mass)) c call WRITEDIAGFI(ngrid,'Nsurf','N particles', c & 'N.m-2',2,qsurf(1,igcm_dust_number)) c call WRITEDIAGFI(ngrid,'dqsdev','ddevil lift', c & 'kg.m-2.s-1',2,zdqsdev(1,1)) c call WRITEDIAGFI(ngrid,'dqssed','sedimentation', c & 'kg.m-2.s-1',2,zdqssed(1,1)) c call WRITEDIAGFI(ngrid,'dqsdif','diffusion', c & 'kg.m-2.s-1',2,zdqsdif(1,1)) call WRITEDIAGFI(ngrid,'dqsdust', & 'deposited surface dust mass', & 'kg.m-2.s-1',2,dqdustsurf) call WRITEDIAGFI(ngrid,'dqndust', & 'deposited surface dust number', & 'number.m-2.s-1',2,dndustsurf) call WRITEDIAGFI(ngrid,'reffdust','reffdust', & 'm',3,rdust*ref_r0) call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', & 'kg/kg',3,qdust) call WRITEDIAGFI(ngrid,'dustN','Dust number', & 'part/kg',3,ndust) #ifdef MESOINI ! !!! to initialize mesoscale we need scaled variables ! !!! because this must correspond to starting point for tracers ! call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', ! & 'kg/kg',3,pq(1:ngrid,1:nlayer,igcm_dust_mass)) ! call WRITEDIAGFI(ngrid,'dustN','Dust number', ! & 'part/kg',3,pq(1:ngrid,1:nlayer,igcm_dust_number)) ! call WRITEDIAGFI(ngrid,'ccn','Nuclei mass mr', ! & 'kg/kg',3,pq(1:ngrid,1:nlayer,igcm_ccn_mass)) ! call WRITEDIAGFI(ngrid,'ccnN','Nuclei number', ! & 'part/kg',3,pq(1:ngrid,1:nlayer,igcm_ccn_number)) call WRITEDIAGFI(ngrid,'dustq','Dust mass mr', & 'kg/kg',3,pq(1,1,igcm_dust_mass)) call WRITEDIAGFI(ngrid,'dustN','Dust number', & 'part/kg',3,pq(1,1,igcm_dust_number)) call WRITEDIAGFI(ngrid,'ccn','Nuclei mass mr', & 'kg/kg',3,pq(1,1,igcm_ccn_mass)) call WRITEDIAGFI(ngrid,'ccnN','Nuclei number', & 'part/kg',3,pq(1,1,igcm_ccn_number)) #endif else do iq=1,dustbin write(str2(1:2),'(i2.2)') iq call WRITEDIAGFI(ngrid,'q'//str2,'mix. ratio', & 'kg/kg',3,zq(1,1,iq)) call WRITEDIAGFI(ngrid,'qsurf'//str2,'qsurf', & 'kg.m-2',2,qsurf(1,iq)) end do endif ! (doubleq) if (scavenging) then call WRITEDIAGFI(ngrid,'ccnq','CCN mass mr', & 'kg/kg',3,qccn) call WRITEDIAGFI(ngrid,'ccnN','CCN number', & 'part/kg',3,nccn) endif ! (scavenging) c if (submicron) then c call WRITEDIAGFI(ngrid,'dustsubm','subm mass mr', c & 'kg/kg',3,pq(1,1,igcm_dust_submicron)) c endif ! (submicron) end if ! (tracer.and.(dustbin.ne.0)) c ---------------------------------------------------------- c Thermospheric outputs c ---------------------------------------------------------- if(callthermos) then call WRITEDIAGFI(ngrid,"q15um","15 um cooling","K/s", $ 3,zdtnlte) call WRITEDIAGFI(ngrid,"quv","UV heating","K/s", $ 3,zdteuv) call WRITEDIAGFI(ngrid,"cond","Thermal conduction","K/s", $ 3,zdtconduc) call WRITEDIAGFI(ngrid,"qnir","NIR heating","K/s", $ 3,zdtnirco2) endif !(callthermos) c ---------------------------------------------------------- c ---------------------------------------------------------- c PBL OUTPUS c ---------------------------------------------------------- c ---------------------------------------------------------- c ---------------------------------------------------------- c Outputs of thermals c ---------------------------------------------------------- if (calltherm) then ! call WRITEDIAGFI(ngrid,'dtke', ! & 'tendance tke thermiques','m**2/s**2', ! & 3,dtke_th) ! call WRITEDIAGFI(ngrid,'d_u_ajs', ! & 'tendance u thermiques','m/s', ! & 3,pdu_th*ptimestep) ! call WRITEDIAGFI(ngrid,'d_v_ajs', ! & 'tendance v thermiques','m/s', ! & 3,pdv_th*ptimestep) ! if (tracer) then ! if (nq .eq. 2) then ! call WRITEDIAGFI(ngrid,'deltaq_th', ! & 'delta q thermiques','kg/kg', ! & 3,ptimestep*pdq_th(:,:,2)) ! endif ! endif call WRITEDIAGFI(ngrid,'zmax_th', & 'hauteur du thermique','m', & 2,zmax_th) call WRITEDIAGFI(ngrid,'hfmax_th', & 'maximum TH heat flux','K.m/s', & 2,hfmax_th) call WRITEDIAGFI(ngrid,'wstar', & 'maximum TH vertical velocity','m/s', & 2,wstar) endif c ---------------------------------------------------------- c ---------------------------------------------------------- c END OF PBL OUTPUS c ---------------------------------------------------------- c ---------------------------------------------------------- c ---------------------------------------------------------- c Output in netcdf file "diagsoil.nc" for subterranean c variables (output every "ecritphy", as for writediagfi) c ---------------------------------------------------------- ! Write soil temperature ! call writediagsoil(ngrid,"soiltemp","Soil temperature","K", ! & 3,tsoil) ! Write surface temperature ! call writediagsoil(ngrid,"tsurf","Surface temperature","K", ! & 2,tsurf) c ========================================================== c END OF WRITEDIAGFI c ========================================================== #endif ELSE ! if(ngrid.eq.1) write(*,'("Ls =",f11.6," tauref(",f4.0," Pa) =",f9.6)') & zls*180./pi,odpref,tauref c ---------------------------------------------------------------------- c Output in grads file "g1d" (ONLY when using testphys1d) c (output at every X physical timestep) c ---------------------------------------------------------------------- c c CALL writeg1d(ngrid,1,fluxsurf_lw,'Fs_ir','W.m-2') c CALL writeg1d(ngrid,1,tsurf,'tsurf','K') c CALL writeg1d(ngrid,1,ps,'ps','Pa') c CALL writeg1d(ngrid,nlayer,zt,'T','K') c CALL writeg1d(ngrid,nlayer,pu,'u','m.s-1') c CALL writeg1d(ngrid,nlayer,pv,'v','m.s-1') c CALL writeg1d(ngrid,nlayer,pw,'w','m.s-1') ! THERMALS STUFF 1D if(calltherm) then call WRITEDIAGFI(ngrid,'lmax_th', & 'hauteur du thermique','point', & 0,lmax_th_out) call WRITEDIAGFI(ngrid,'zmax_th', & 'hauteur du thermique','m', & 0,zmax_th) call WRITEDIAGFI(ngrid,'hfmax_th', & 'maximum TH heat flux','K.m/s', & 0,hfmax_th) call WRITEDIAGFI(ngrid,'wstar', & 'maximum TH vertical velocity','m/s', & 0,wstar) co2col(:)=0. if (tracer) then do l=1,nlayer do ig=1,ngrid co2col(ig)=co2col(ig)+ & zq(ig,l,1)*(zplev(ig,l)-zplev(ig,l+1))/g enddo enddo end if call WRITEDIAGFI(ngrid,'co2col','integrated co2 mass' & & ,'kg/m-2',0,co2col) endif ! of if (calltherm) call WRITEDIAGFI(ngrid,'w','vertical velocity' & & ,'m/s',1,pw) call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",1,q2) call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",0, & tsurf) call WRITEDIAGFI(ngrid,"u","u wind","m/s",1,zu) call WRITEDIAGFI(ngrid,"v","v wind","m/s",1,zv) call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",1,zplay) call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",1,zplev) call WRITEDIAGFI(ngrid,"rho","rho","kg.m-3",1,rho) ! call WRITEDIAGFI(ngrid,"dtrad","rad. heat. rate", & ! & "K.s-1",1,dtrad/zpopsk) ! call WRITEDIAGFI(ngrid,'sw_htrt','sw heat. rate', ! & 'w.m-2',1,zdtsw/zpopsk) ! call WRITEDIAGFI(ngrid,'lw_htrt','lw heat. rate', ! & 'w.m-2',1,zdtlw/zpopsk) call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness" & ,"kg.m-2",0,co2ice) ! or output in diagfi.nc (for testphys1d) call WRITEDIAGFI(ngrid,'ps','Surface pressure','Pa',0,ps) call WRITEDIAGFI(ngrid,'temp','Temperature', & 'K',1,zt) if(tracer) then c CALL writeg1d(ngrid,1,tau,'tau','SI') do iq=1,nq c CALL writeg1d(ngrid,nlayer,zq(1,1,iq),noms(iq),'kg/kg') call WRITEDIAGFI(ngrid,trim(noms(iq)), & trim(noms(iq)),'kg/kg',1,zq(1,1,iq)) end do if (doubleq) then call WRITEDIAGFI(ngrid,'rdust','rdust', & 'm',1,rdust) endif if (water.AND.tifeedback) then call WRITEDIAGFI(ngrid,"soiltemp", & "Soil temperature","K", & 1,tsoil) call WRITEDIAGFI(ngrid,'soilti', & 'Soil Thermal Inertia', & 'J.s-1/2.m-2.K-1',1,inertiesoil) endif end if cccccccccccccccccc scavenging & water outputs 1D TN ccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc IF (water) THEN if (.not.activice) then tauTES=0 do l=1,nlayer Qabsice = min( & max(0.4e6*rice(1,l)*(1.+nuice_ref)-0.05 ,0.),1.2 & ) opTES(1,l)= 0.75 * Qabsice * & zq(1,l,igcm_h2o_ice) * & (zplev(1,l) - zplev(1,l+1)) / g & / (rho_ice * rice(1,l) * (1.+nuice_ref)) tauTES=tauTES+ opTES(1,l) enddo CALL WRITEDIAGFI(ngrid,'tauTESap', & 'tau abs 825 cm-1', & '',0,tauTES) else CALL WRITEDIAGFI(ngrid,'tauTES', & 'tau abs 825 cm-1', & '',0,taucloudtes) endif mtot = 0 icetot = 0 h2otot = qsurf(1,igcm_h2o_ice) do l=1,nlayer mtot = mtot + zq(1,l,igcm_h2o_vap) & * (zplev(1,l) - zplev(1,l+1)) / g icetot = icetot + zq(1,l,igcm_h2o_ice) & * (zplev(1,l) - zplev(1,l+1)) / g end do h2otot = h2otot+mtot+icetot CALL WRITEDIAGFI(ngrid,'h2otot', & 'h2otot', & 'kg/m2',0,h2otot) CALL WRITEDIAGFI(ngrid,'mtot', & 'mtot', & 'kg/m2',0,mtot) CALL WRITEDIAGFI(ngrid,'icetot', & 'icetot', & 'kg/m2',0,icetot) if (scavenging) then rave = 0 do l=1,nlayer cccc Column integrated effective ice radius cccc is weighted by total ice surface area (BETTER) rave = rave + tauscaling(1) * & zq(1,l,igcm_ccn_number) * & (zplev(1,l) - zplev(1,l+1)) / g * & rice(1,l) * rice(1,l)* (1.+nuice_ref) enddo rave=icetot*0.75/max(rave*pi*rho_ice,1.e-30) ! surface weight Nccntot= 0 call watersat(ngrid*nlayer,zt,zplay,zqsat) do l=1,nlayer Nccntot = Nccntot + & zq(1,l,igcm_ccn_number)*tauscaling(1) & *(zplev(1,l) - zplev(1,l+1)) / g satu(1,l) = zq(1,l,igcm_h2o_vap)/zqsat(1,l) satu(1,l) = (max(satu(1,l),float(1))-1) ! & * zq(1,l,igcm_h2o_vap) * ! & (zplev(1,l) - zplev(1,l+1)) / g enddo call WRITEDIAGFI(ngrid,"satu","vap in satu","kg/kg",1, & satu) CALL WRITEDIAGFI(ngrid,'Nccntot', & 'Nccntot', & 'nbr/m2',0,Nccntot) call WRITEDIAGFI(ngrid,'zdqsed_dustq' & ,'sedimentation q','kg.m-2.s-1',1,zdqsed(1,:,igcm_dust_mass)) call WRITEDIAGFI(ngrid,'zdqsed_dustN' &,'sedimentation N','Nbr.m-2.s-1',1, & zdqsed(1,:,igcm_dust_number)) else ! of if (scavenging) cccc Column integrated effective ice radius cccc is weighted by total ice mass (LESS GOOD) rave = 0 do l=1,nlayer rave = rave + zq(1,l,igcm_h2o_ice) & * (zplev(1,l) - zplev(1,l+1)) / g & * rice(1,l) * (1.+nuice_ref) enddo rave=max(rave/max(icetot,1.e-30),1.e-30) ! mass weight endif ! of if (scavenging) CALL WRITEDIAGFI(ngrid,'reffice', & 'reffice', & 'm',0,rave) do iq=1,nq call WRITEDIAGFI(ngrid,trim(noms(iq))//'_s', & trim(noms(iq))//'_s','kg/kg',0,qsurf(1,iq)) end do call WRITEDIAGFI(ngrid,'zdqcloud_ice','cloud ice', & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_ice)) call WRITEDIAGFI(ngrid,'zdqcloud_vap','cloud vap', & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_vap)) call WRITEDIAGFI(ngrid,'zdqcloud','cloud ice', & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_ice) & +zdqcloud(1,:,igcm_h2o_vap)) call WRITEDIAGFI(ngrid,"rice","ice radius","m",1, & rice) ENDIF ! of IF (water) ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc zlocal(1)=-log(zplay(1,1)/zplev(1,1))* Rnew(1,1)*zt(1,1)/g do l=2,nlayer-1 tmean=zt(1,l) if(zt(1,l).ne.zt(1,l-1)) & tmean=(zt(1,l)-zt(1,l-1))/log(zt(1,l)/zt(1,l-1)) zlocal(l)= zlocal(l-1) & -log(zplay(1,l)/zplay(1,l-1))*rnew(1,l)*tmean/g enddo zlocal(nlayer)= zlocal(nlayer-1)- & log(zplay(1,nlayer)/zplay(1,nlayer-1))* & rnew(1,nlayer)*tmean/g END IF ! if(ngrid.ne.1) icount=icount+1 RETURN END