Changeset 3228 for trunk/LMDZ.PLUTO


Ignore:
Timestamp:
Feb 20, 2024, 4:46:35 PM (9 months ago)
Author:
tbertrand
Message:

Pluto GCM:
Cleaning code and adding extra options for newstart.F

Location:
trunk/LMDZ.PLUTO/libf
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/newstart.F

    r3198 r3228  
    120120      real mugaz ! molar mass of the atmosphere
    121121
    122       integer ierr
     122      integer ierr,iref
    123123
    124124c Variables on the new grid along scalar points
     
    585585      write(*,*) 'qs=x : give a uniform value to a surface tracer'
    586586      write(*,*) 'q=profile    : specify a profile for a tracer'
     587      write(*,*) 'subsoil_all : set seasonal subsurface thermal inertia'
     588      write(*,*) 'diurnal_TI : set diurnal subsurface thermal inertia'
    587589
    588590        write(*,*)
     
    824826
    825827
     828
     829c       subsoil_all : initialize subsurface thermal inertia
     830c       --------------------------------------------------
     831        else if (modif(1:len_trim(modif)) .eq. 'subsoil_all') then
     832
     833          write(*,*) 'New value for subsoil thermal inertia  ?'
     834 104      read(*,*,iostat=ierr) ith_bb
     835          if(ierr.ne.0) goto 104
     836          write(*,*) 'thermal inertia (new value):',ith_bb
     837
     838          write(*,*)'At which depth (in m.) does the ice layer begin?'
     839          write(*,*)'(here, the deepest soil layer extends down to:'
     840     &              ,layer(1),' - ',layer(nsoilmx),')'
     841          write(*,*)'write 0 for uniform value for all subsurf levels?'
     842          ierr=1
     843          do while (ierr.ne.0)
     844           read(*,*,iostat=ierr) val2
     845           write(*,*)'val2 in subsoil_all:',val2,'ierr=',ierr
     846           if (ierr.eq.0) then ! got a value, but do a sanity check
     847             if(val2.gt.layer(nsoilmx)) then
     848               write(*,*)'Depth should be less than ',layer(nsoilmx)
     849               ierr=1
     850             endif
     851             if(val2.lt.layer(1)) then
     852              if(val2.eq.0) then
     853               write(*,*)'Thermal inertia set for all subsurface layers'
     854               ierr=0
     855              else
     856               write(*,*)'Depth should be more than ',layer(1)
     857               ierr=1
     858              endif
     859             endif
     860           endif
     861          enddo ! of do while
     862
     863          ! find the reference index iref the depth corresponds to
     864          if(val2.eq.0) then
     865           iref=1
     866           write(*,*)'Level selected is first level: ',layer(iref),' m'
     867          else
     868           do isoil=1,nsoilmx-1
     869            if ((val2.gt.layer(isoil)).and.(val2.lt.layer(isoil+1)))
     870     &       then
     871             iref=isoil+1
     872             write(*,*)'Level selected : ',layer(isoil+1),' m'
     873             exit
     874            endif
     875           enddo
     876          endif
     877
     878          DO ig=1,ngridmx
     879             DO j=iref,nsoilmx
     880                   ithfi(ig,j)=ith_bb
     881             ENDDO
     882          ENDDO
     883
     884          CALL gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith)
     885
     886c       diurnal_TI : choice of thermal inertia values (global)
     887c       ----------------------------------------------------------------
     888        else if (modif(1:len_trim(modif)) .eq. 'diurnal_TI') then
     889
     890         write(*,*) 'New value for diurnal thermal inertia  ?'
     891 106     read(*,*,iostat=ierr) ith_bb
     892         if(ierr.ne.0) goto 106
     893         write(*,*) 'Diurnal thermal inertia (new value):',ith_bb
     894
     895         write(*,*)'At which depth (in m.) does the ice layer ends?'
     896         write(*,*)'(currently, the soil layer 1 and nsoil are:'
     897     &              ,layer(1),' - ',layer(nsoilmx),')'
     898         ierr=1
     899         do while (ierr.ne.0)
     900          read(*,*,iostat=ierr) val2
     901          write(*,*)'val2 in diurnal_TI:',val2,'ierr=',ierr
     902          if (ierr.eq.0) then ! got a value, but do a sanity check
     903            if(val2.gt.layer(nsoilmx)) then
     904              write(*,*)'Depth should be less than ',layer(nsoilmx)
     905              ierr=1
     906            endif
     907            if(val2.lt.layer(1)) then
     908              write(*,*)'Depth should be more than ',layer(1)
     909              ierr=1
     910            endif
     911          endif
     912         enddo ! of do while
     913
     914           ! find the reference index iref the depth corresponds to
     915         do isoil=1,nsoilmx-1
     916            !write(*,*)'isoil, ',isoil,val2
     917            !write(*,*)'lay(i),lay(i+1):',layer(isoil),layer(isoil+1),' m'
     918            if ((val2.gt.layer(isoil)).and.(val2.lt.layer(isoil+1)))
     919     &       then
     920             iref=isoil+1
     921             write(*,*)'Level selected : ',layer(isoil+1),' m'
     922             exit
     923            endif
     924         enddo
     925
     926         DO ig=1,ngridmx
     927             DO j=1,iref
     928                   ithfi(ig,j)=ith_bb
     929             ENDDO
     930         ENDDO
     931
     932         CALL gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,ithfi,ith)
     933
     934
     935
     936
     937
     938
     939
     940
     941
     942
     943
     944
     945
     946
     947
     948
     949
     950
     951
     952
     953
     954
     955
     956
    826957        endif
    827958             
  • trunk/LMDZ.PLUTO/libf/phypluto/comsoil_h.F90

    r3184 r3228  
    55!integer, parameter :: nsoilmx = 18 ! for z1=0.0002 m, depth = 18 m => mars case
    66!integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case
    7   integer,save :: nsoilmx = 18 ! default, but may be set in callphys.def
     7  integer,save :: nsoilmx = 24 ! default, but may be set in callphys.def
    88! Full soil layer depths are set as: layer(k)=lay1_soil*alpha_soil**(k-1) , k=1,nsoil
    99! Mid soil layer depths are set as: mlayer(k)=lay1_soil*alpha_soil**(k-1/2) , k=0,nsoil-1
  • trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90

    r3195 r3228  
    130130  REAL globzplevnew
    131131
    132   REAL vmrn2(klon)
     132!   REAL vmrn2(klon)
    133133!   SAVE vmrn2
    134134  REAL stephan
     
    172172     ! calculate global mean surface pressure for the fast mode
    173173     IF (fast) THEN
     174        IF (.not. ALLOCATED(kp)) ALLOCATE(kp(klon))
    174175        DO ig=1,klon
    175176           kp(ig) = exp(-phisfi(ig)/(r*38.))
     
    178179     ENDIF
    179180
    180      vmrn2(:) = 1.
    181      IF (ch4lag) then
    182         DO ig=1,klon
    183            if (latitude(ig)*180./pi.ge.latlag) then
    184               vmrn2(ig) = vmrlag
    185            endif
    186         ENDDO
    187      ENDIF
    188      IF (no_n2frost) then
    189         DO ig=1,klon
    190            if (picen2(ig).eq.0.) then
    191               vmrn2(ig) = 1.e-15
    192            endif
    193         ENDDO
    194      ENDIF
     181     !vmrn2(:) = 1.
     182     !IF (ch4lag) then
     183     !   DO ig=1,klon
     184     !      if (latitude(ig)*180./pi.ge.latlag) then
     185     !         vmrn2(ig) = vmrlag
     186     !      endif
     187     !   ENDDO
     188     !ENDIF
     189     !IF (no_n2frost) then
     190     !   DO ig=1,klon
     191     !      if (picen2(ig).eq.0.) then
     192     !         vmrn2(ig) = 1.e-15
     193     !      endif
     194     !   ENDDO
     195     !ENDIF
    195196     firstcall=.false.
    196197  ENDIF
     
    343344   DO ig=1,klon
    344345     ! forecast of frost temperature ztcondsol
    345      !ztcondsol(ig) = tcond_n2(zplev(ig),zqn2(ig,1))
    346      ztcondsol(ig) = tcond_n2(zplev(ig),vmrn2(ig))
     346     ztcondsol(ig) = tcond_n2(zplev(ig),zqn2(ig,1))
     347     !ztcondsol(ig) = tcond_n2(zplev(ig),vmrn2(ig))
    347348
    348349!     Loop over where we have condensation / sublimation
     
    633634             if((pq(ig,l,iq) +(pdqc(ig,l,iq)+ pdq(ig,l,iq))*ptimestep) &
    634635                     .lt.0.01) then ! if n2 < 1 %  !
    635                pdqc(ig,l,iq)=(0.01-pq(ig,l,iq))/ptimestep-pdq(ig,l,iq)
     636                     write(*,*) 'Warning: n2 < 1%'
     637                     pdqc(ig,l,iq)=(0.01-pq(ig,l,iq))/ptimestep-pdq(ig,l,iq)
    636638             end if
    637639            end if
  • trunk/LMDZ.PLUTO/libf/phypluto/inifis_mod.F90

    r3197 r3228  
    176176     if (is_master) write(*,*) trim(rname)//": season = ",season
    177177
     178     if (is_master) then
     179       write(*,*) trim(rname)//": Fast mode (nogcm) ?"
     180     endif
     181     fast=.false. ! default value
     182     call getin_p("fast",fast)
     183     if (is_master) write(*,*) trim(rname)//": fast = ",fast
     184
    178185     if (is_master) write(*,*) trim(rname)//&
    179186       ": No seasonal cycle: initial day to lock the run during restart"
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3198 r3228  
    4545      use comcstfi_mod, only: pi, g, rcp, r, rad, mugaz, cpp
    4646      use time_phylmdz_mod, only: daysec
    47       use callkeys_mod, only: albedo_spectral_mode, calladj, calldifv, &
     47      use callkeys_mod, only: fast,albedo_spectral_mode, calladj, calldifv, &
    4848                              callrad, callsoil, nosurf, &
    4949                              aerohaze, corrk, diagdtau,&
     
    293293      ! For Surface Tracers : (kg/m2/s)
    294294      real dqsurf(ngrid,nq)                 ! Cumulated tendencies.
    295       real zdqsurfc(ngrid)                  ! Condense_n2 routine.
     295      !real zdqsurfc(ngrid)                  ! Condense_n2 routine.
    296296      REAL zdqsc(ngrid,nq)                  ! Condense_n2 routine.
    297297      real zdqsdif(ngrid,nq)                ! Turbdiff/vdifc routines.
     
    768768     ! w = F / (rho*area) and rho = P/(r*T)
    769769     ! But first linearly interpolate mass flux to mid-layers
    770       do l=1,nlayer-1
     770      if (.not.fast) then
     771       do l=1,nlayer-1
    771772         pw(1:ngrid,l)=0.5*(flxw(1:ngrid,l)+flxw(1:ngrid,l+1))
    772       enddo
    773       pw(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0
    774       do l=1,nlayer
     773       enddo
     774       pw(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0
     775       do l=1,nlayer
    775776         pw(1:ngrid,l)=(pw(1:ngrid,l)*r*pt(1:ngrid,l)) /  &
    776777                       (pplay(1:ngrid,l)*cell_area(1:ngrid))
    777       enddo
    778       ! omega in Pa/s
    779       do l=1,nlayer-1
     778       enddo
     779       ! omega in Pa/s
     780       do l=1,nlayer-1
    780781         omega(1:ngrid,l)=0.5*(flxw(1:ngrid,l)+flxw(1:ngrid,l+1))
    781       enddo
    782       omega(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0
    783       do l=1,nlayer
     782       enddo
     783       omega(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0
     784       do l=1,nlayer
    784785         omega(1:ngrid,l)=g*omega(1:ngrid,l)/cell_area(1:ngrid)
    785       enddo
    786 
     786       enddo
     787      endif
    787788!---------------------------------
    788789! II. Compute radiative tendencies
     
    922923               albedo_equivalent(1:ngrid)=albedo(1:ngrid,1)
    923924               fluxsurfabs_sw(1:ngrid) = fluxtop_dn(1:ngrid)*(1.-albedo(1:ngrid,1))
    924                ! TB24:
    925925               fluxabs_sw(1:ngrid)=fluxsurfabs_sw(1:ngrid)
    926926               fluxrad_sky(1:ngrid)    = fluxsurfabs_sw(1:ngrid)
     
    11381138
    11391139         pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+zdtc(1:ngrid,1:nlayer)
     1140         pdv(1:ngrid,1:nlayer) = pdv(1:ngrid,1:nlayer)+zdvc(1:ngrid,1:nlayer)
     1141         pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer)+zduc(1:ngrid,1:nlayer)
    11401142         zdtsurf(1:ngrid)      = zdtsurf(1:ngrid) + zdtsurfc(1:ngrid)
    11411143
    11421144         pdq(1:ngrid,1:nlayer,1:nq)   = pdq(1:ngrid,1:nlayer,1:nq)+ zdqc(1:ngrid,1:nlayer,1:nq)
    1143          ! dqsurf(1:ngrid,igcm_n2_ice) = dqsurf(1:ngrid,igcm_n2_ice) + zdqsurfc(1:ngrid)
     1145         dqsurf(1:ngrid,igcm_n2) = dqsurf(1:ngrid,igcm_n2) + zdqsc(1:ngrid,igcm_n2)
    11441146
    11451147!!         call writediagfi(ngrid,"condense_n2_post_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_vap))
     
    13241326
    13251327      tsurf(1:ngrid)=tsurf(1:ngrid)+ptimestep*zdtsurf(1:ngrid)
    1326 
    13271328      ! Compute soil temperatures and subsurface heat flux.
    13281329      if (callsoil) then
     
    13781379      ! Surface pressure.
    13791380      ps(1:ngrid) = pplev(1:ngrid,1) + pdpsrf(1:ngrid)*ptimestep
    1380 
    13811381
    13821382
     
    16451645      call writediagfi(ngrid,"tsurf","Surface temperature","K",2,tsurf)
    16461646      call writediagfi(ngrid,"ps","Surface pressure","Pa",2,ps)
    1647       call writediagfi(ngrid,"temp","temperature","K",3,zt)
    1648       call writediagfi(ngrid,"teta","potential temperature","K",3,zh)
    1649       call writediagfi(ngrid,"u","Zonal wind","m.s-1",3,zu)
    1650       call writediagfi(ngrid,"v","Meridional wind","m.s-1",3,zv)
    1651       call writediagfi(ngrid,"w","Vertical wind","m.s-1",3,pw)
    1652       call writediagfi(ngrid,"p","Pressure","Pa",3,pplay)
     1647
     1648      if (.not.fast) then
     1649       call writediagfi(ngrid,"temp","temperature","K",3,zt)
     1650       call writediagfi(ngrid,"teta","potential temperature","K",3,zh)
     1651       call writediagfi(ngrid,"u","Zonal wind","m.s-1",3,zu)
     1652       call writediagfi(ngrid,"v","Meridional wind","m.s-1",3,zv)
     1653       call writediagfi(ngrid,"w","Vertical wind","m.s-1",3,pw)
     1654       call writediagfi(ngrid,"p","Pressure","Pa",3,pplay)
     1655      endif
    16531656
    16541657!     Subsurface temperatures
  • trunk/LMDZ.PLUTO/libf/phypluto/soil.F

    r3184 r3228  
    6969        do ik=0,nsoil-1
    7070          mthermdiff(ig,ik)=therm_i(ig,ik+1)*therm_i(ig,ik+1)/volcapa
    71 !         write(*,*),'soil: ik: ',ik,' mthermdiff:',mthermdiff(ig,ik)
     71          !write(*,*),'soil: ik: ',ik,' mthermdiff:',mthermdiff(ig,ik)
    7272        enddo
    7373      enddo
  • trunk/LMDZ.PLUTO/libf/phypluto/surfini.F

    r3198 r3228  
    4444      ! Step 2 : We get the bare ground albedo from the start files.
    4545      DO ig=1,ngrid
    46          albedo_bareground(ig)=0.1 ! TB24 albedodat(ig)
     46         albedo_bareground(ig)=0.7 ! albedodat(ig)
    4747         DO nw=1,L_NSPECTV
    48             albedo(ig,nw)=0.1 !albedo_bareground(ig)
     48            albedo(ig,nw)=0.7 !albedo_bareground(ig)
    4949         ENDDO
    5050      ENDDO
  • trunk/LMDZ.PLUTO/libf/phypluto/turbdiff_mod.F90

    r3198 r3228  
    138138
    139139      IF (firstcall) THEN
    140          ivap=1 !TB24
     140         ivap=1
    141141         iliq=0
    142142         iliq_surf=0
Note: See TracChangeset for help on using the changeset viewer.