Changeset 4060 for trunk/LMDZ.MARS/libf


Ignore:
Timestamp:
Feb 10, 2026, 11:19:31 AM (3 weeks ago)
Author:
emillour
Message:

Mars PCM:
Some code cleanup:

  • remove obsolete "eofdump" routine and related "calleofdump" flag
  • remove obsolete "callg2d" flag
  • rename vague and non-descriptive "linear" flag as "lwxn_linear" (as it is only used in lwxn routine), likewise rename "alphan" "lwxn_alphan" and "ncouche" "lwxn_ncouche" And move these 3 flags from callkeys_mod to the lwxn module

EM

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/callkeys_mod.F90

    r4054 r4060  
    1010logical,save :: season,diurnal,calllott,calllott_nonoro
    1111!$OMP THREADPRIVATE(season,diurnal,calllott,calllott_nonoro)
    12 logical,save :: calleofdump
    13 !$OMP THREADPRIVATE(calleofdump)
    1412logical,save :: callnirco2,callnlte,callthermos,callconduct
    1513!$OMP THREADPRIVATE(callnirco2,callnlte,callthermos,callconduct)
     
    2119!$OMP THREADPRIVATE(callyamada4,callatke)
    2220logical,save :: callemis
    23 logical,save :: callg2d
    24 !$OMP THREADPRIVATE(callemis,callg2d)
    25 logical,save :: linear ! ?!?
    26 !$OMP THREADPRIVATE(linear)
     21!$OMP THREADPRIVATE(callemis)
    2722logical,save :: gwd_convective_source
    2823!$OMP THREADPRIVATE(gwd_convective_source)
     
    3025real,save :: semi ! ?!?
    3126!$OMP THREADPRIVATE(semi)
    32 real,save :: alphan ! ?!?
    33 !$OMP THREADPRIVATE(alphan)
    3427real,save :: fixed_euv_value
    3528!$OMP THREADPRIVATE(fixed_euv_value)
     
    5649integer,save :: ilwn
    5750!$OMP THREADPRIVATE(ilwd,ilwb,ilwn)
    58 integer,save :: ncouche
    59 !$OMP THREADPRIVATE(ncouche)
    6051integer,save :: solvarmod   ! model for solar EUV variation
    6152!$OMP THREADPRIVATE(solvarmod)
  • trunk/LMDZ.MARS/libf/phymars/conf_phys.F

    r4058 r4060  
    4646     &                     ads_massive_ice
    4747      use nonoro_gwd_mix_mod, only: calljliu_gwimix
     48      use lwxn_mod, only: lwxn_linear, lwxn_alphan, lwxn_ncouche
    4849      use callkeys_mod, only: startphy_file, activice, activeco2ice,
    49      &                        alphan, calladj, callatke, callcond,
     50     &                        calladj, callatke, callcond,
    5051     &                        callconduct, calldifv, callemis,
    51      &                        calleofdump, calleuv, callg2d, calllott,
     52     &                        calleuv, calllott,
    5253     &                        calllott_nonoro, callmoldiff, callmolvis,
    5354     &                        callnirco2, callnlte, callrad, callrichsl,
     
    6162     &                        euveff, fixed_euv_value, hdo, hdofrac,
    6263     &                        iaervar, ilwb, ilwd, ilwn, iradia,
    63      &                        linear, latentheat_surfwater, microphys,
    64      &                        meteo_flux, ncouche, nircorr, nltemodel,
     64     &                        latentheat_surfwater, microphys,
     65     &                        meteo_flux,
     66     &                        nircorr, nltemodel,
    6567     &                        photochem, poreice_tifeedback, rayleigh,
    6668     &                        rdstorm, refill_watercap, satindexco2,
     
    8789      real :: albedo_perennialco2_north, albedo_perennialco2_south
    8890 
     91      logical :: callg2d ! obsolete unused  flag... (but could be read from radia.def ?)
     92
    8993      CHARACTER ch1*12
    9094#ifndef MESOSCALE
     
    187191         write(*,*) " diagsoil = ",diagsoil
    188192         
    189          write(*,*) "Save EOF profiles in file 'profiles' for ",
    190      &              "Climate Database?"
    191          calleofdump=.false. ! default value
    192          call getin_p("calleofdump",calleofdump)
    193          write(*,*) " calleofdump = ",calleofdump
    194 
    195193         write(*,*) "Dust scenario: 1=constant dust (read from startfi",
    196194     &   " or set as tauvis); 2=Viking scenario; =3 MGS scenario,",
    197195     &   "=6 cold (low dust) scenario; =7 warm (high dust) scenario ",
    198      &   "=24,25 ... 30 :Mars Year 24, ... or 30 from TES assimilation"
    199          iaervar=3 ! default value
     196     &   "=8 climatology scenario (our best guess of a standard Mars)",
     197     &   "=24,25 ... 36,37 : Mars Year 24, ... 37 from observed dust"
     198         iaervar=8 ! default value
    200199         call getin_p("iaervar",iaervar)
    201200         write(*,*) " iaervar = ",iaervar
     
    418417         write(*,*)" iradia = ",iradia
    419418         
    420 
    421          write(*,*)"Output of the exchange coefficient mattrix ?",
    422      &             "(for diagnostics only)"
    423          callg2d=.false. ! default value
    424          call getin_p("callg2d",callg2d)
    425          write(*,*)" callg2d = ",callg2d
    426419
    427420         write(*,*)"Rayleigh scattering : (should be .false. for now)"
     
    13001293      ilwn=1 !2
    13011294      ilwb=1 !2
    1302       linear=.true.       
    1303       ncouche=3
    1304       alphan=0.4
     1295      lwxn_linear=.true.       
     1296      lwxn_ncouche=3
     1297      lwxn_alphan=0.4
    13051298      semi=0
    13061299
     
    13291322
    13301323         READ(99,fmt='(a)') ch1
    1331          READ(99,*) linear
    1332          WRITE(*,8000) ch1,linear
     1324         READ(99,*) lwxn_linear
     1325         WRITE(*,8000) ch1,lwxn_linear
    13331326
    13341327         READ(99,fmt='(a)') ch1
    1335          READ(99,*) ncouche
    1336          WRITE(*,8001) ch1,ncouche
     1328         READ(99,*) lwxn_ncouche
     1329         WRITE(*,8001) ch1,lwxn_ncouche
    13371330
    13381331         READ(99,fmt='(a)') ch1
    1339          READ(99,*) alphan
    1340          WRITE(*,*) ch1,alphan
     1332         READ(99,*) lwxn_alphan
     1333         WRITE(*,*) ch1,lwxn_alphan
    13411334
    13421335         READ(99,fmt='(a)') ch1
     
    13611354      call bcast(ilwd)
    13621355      call bcast(ilwn)
    1363       call bcast(linear)
    1364       call bcast(ncouche)
    1365       call bcast(alphan)
     1356      call bcast(lwxn_linear)
     1357      call bcast(lwxn_ncouche)
     1358      call bcast(lwxn_alphan)
    13661359      call bcast(ilwb)
    13671360      call bcast(callg2d)
  • trunk/LMDZ.MARS/libf/phymars/lwxn.F

    r3757 r4060  
    22     
    33      implicit none
     4     
     5      logical,save :: lwxn_linear
     6!$OMP THREADPRIVATE(lwxn_linear)
     7      real,save :: lwxn_alphan
     8!$OMP THREADPRIVATE(lwxn_alphan)
     9      integer,save :: lwxn_ncouche
     10!$OMP THREADPRIVATE(lwxn_ncouche)
     11     
    412     
    513      contains
     
    5361c                                       sublayer    3                 
    5462c                                ----------------------------- nj=4
    55 c                                       sublayer  ncouche                 
    56 c  *********************************************************** ni=nj=ncouche+1
    57 c                                       sublayer  ncouche                 
     63c                                       sublayer  lwxn_ncouche                 
     64c  *********************************************************** ni=nj=lwxn_ncouche+1
     65c                                       sublayer  lwxn_ncouche                 
    5866c                                ----------------------------- ni=4
    5967c                                       sublayer    3                 
     
    7886      use dimradmars_mod, only: ndlo2, nuco2, ndlon, nflev
    7987      use yomlw_h, only: nlaylte, xi, xi_ground, xi_emis
    80       use callkeys_mod, only: linear, alphan, ncouche
    8188      use lwtt_mod, only: lwtt
    8289      implicit none
     
    135142c               --------------
    136143
    137       jk=ncouche+1
     144      jk=lwxn_ncouche+1
    138145      do ja = 1 ,nuco2
    139146        do jl = 1 , kdlon
     
    147154      enddo
    148155
    149       if (linear) then
    150 
    151       do nlmd = 1 ,ncouche
    152         cn(nlmd)=(1.0/ncouche)
    153         cb(nlmd)=(ncouche-nlmd+0.5)/ncouche
     156      if (lwxn_linear) then
     157
     158      do nlmd = 1 ,lwxn_ncouche
     159        cn(nlmd)=(1.0/lwxn_ncouche)
     160        cb(nlmd)=(lwxn_ncouche-nlmd+0.5)/lwxn_ncouche
    154161c       print*,nlmd,cb(nlmd),cn(nlmd)
    155162      enddo
     
    157164      else
    158165
    159       do nlmd = 1 ,ncouche-1
    160         cn(nlmd)=(1-alphan)*alphan**(nlmd-1)
    161         cb(nlmd)=0.5*(1+alphan)*alphan**(nlmd-1)
    162       enddo
    163       cn(ncouche)=alphan**(ncouche-1)
    164       cb(ncouche)=0.5*alphan**(ncouche-1)
     166      do nlmd = 1 ,lwxn_ncouche-1
     167        cn(nlmd)=(1-lwxn_alphan)*lwxn_alphan**(nlmd-1)
     168        cb(nlmd)=0.5*(1+lwxn_alphan)*lwxn_alphan**(nlmd-1)
     169      enddo
     170      cn(lwxn_ncouche)=lwxn_alphan**(lwxn_ncouche-1)
     171      cb(lwxn_ncouche)=0.5*lwxn_alphan**(lwxn_ncouche-1)
    165172
    166173      endif
    167174
    168175c test
    169       if (nmax .LT. ncouche) then
     176      if (nmax .LT. lwxn_ncouche) then
    170177        print*,'!!!!! ATTENTION !!!!! '
    171178        print*,'probleme dans lwxn.F'
    172         print*,' nmax=',nmax,'  < ncouche=',ncouche
     179        print*,' nmax=',nmax,'  < lwxn_ncouche=',lwxn_ncouche
    173180        call exit(1)
    174181      endif
     
    190197     .                       / aer_t(jl,ja,jk+1)
    191198                                 
    192       do nlmd=1,ncouche
     199      do nlmd=1,lwxn_ncouche
    193200        zu_i(jl,ja,nlmd)=cn(nlmd)*zu_layer_i(jl,ja)
    194201        zup_i(jl,ja,nlmd)=cn(nlmd)*zup_layer_i(jl,ja)
     
    203210     .                       / aer_t(jl,ja,jk+2)
    204211       
    205       do nlmd=1,ncouche
     212      do nlmd=1,lwxn_ncouche
    206213        zu_j(jl,ja,nlmd)=cn(nlmd)*zu_layer_j(jl,ja)
    207214        zup_j(jl,ja,nlmd)=cn(nlmd)*zup_layer_j(jl,ja)
     
    216223c               ------------------------------------
    217224
    218         do ni = 1 ,ncouche+1
     225        do ni = 1 ,lwxn_ncouche+1
    219226
    220227            do ja = 1 ,nuco2
     
    224231      zt_aer(jl,ja)=1.   
    225232                       
    226       do nlmd=ni,ncouche+1
     233      do nlmd=ni,lwxn_ncouche+1
    227234        zu(jl,ja)=zu(jl,ja)+zu_i(jl,ja,nlmd)   
    228235        zup(jl,ja)=zup(jl,ja)+zup_i(jl,ja,nlmd)   
     
    236243        do ja = 1 ,nuco2
    237244          do jl = 1 , kdlon
    238             trans(jl,ja,ni,ncouche+1)=zt_co2(jl,ja)*zt_aer(jl,ja)
     245            trans(jl,ja,ni,lwxn_ncouche+1)=zt_co2(jl,ja)*zt_aer(jl,ja)
    239246          enddo
    240247        enddo
     
    260267ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
    261268       
    262         do nj = 1 ,ncouche+1
     269        do nj = 1 ,lwxn_ncouche+1
    263270
    264271            do ja = 1 ,nuco2
     
    268275      zt_aer(jl,ja)=1.   
    269276                       
    270       do nlmd=nj,ncouche+1
     277      do nlmd=nj,lwxn_ncouche+1
    271278        zu(jl,ja)=zu(jl,ja)+zu_j(jl,ja,nlmd)   
    272279        zup(jl,ja)=zup(jl,ja)+zup_j(jl,ja,nlmd)   
     
    280287        do ja = 1 ,nuco2
    281288          do jl = 1 , kdlon
    282             trans(jl,ja,ncouche+1,nj)=zt_co2(jl,ja)*zt_aer(jl,ja)
     289            trans(jl,ja,lwxn_ncouche+1,nj)=zt_co2(jl,ja)*zt_aer(jl,ja)
    283290          enddo
    284291        enddo
     
    313320        enddo
    314321
    315         do ni = 1 ,ncouche
     322        do ni = 1 ,lwxn_ncouche
    316323          do ja = 1 ,nuco2
    317324            do jl = 1 , kdlon
    318325
    319326      ksi(jl,ja,jk)=ksi(jl,ja,jk) +
    320      .             ( trans(jl,ja,ni+1,ncouche+1)
    321      .             - trans(jl,ja,ni,ncouche+1)
     327     .             ( trans(jl,ja,ni+1,lwxn_ncouche+1)
     328     .             - trans(jl,ja,ni,lwxn_ncouche+1)
    322329     .             - trans(jl,ja,ni+1,1)
    323330     .             + trans(jl,ja,ni,1) )
     
    329336        enddo
    330337
    331         do nj = 1 ,ncouche
     338        do nj = 1 ,lwxn_ncouche
    332339          do ja = 1 ,nuco2
    333340            do jl = 1 , kdlon
    334341
    335342      ksi(jl,ja,jk)=ksi(jl,ja,jk) +
    336      .             ( trans(jl,ja,ncouche+1,nj+1)
     343     .             ( trans(jl,ja,lwxn_ncouche+1,nj+1)
    337344     .             - trans(jl,ja,1,nj+1)
    338      .             - trans(jl,ja,ncouche+1,nj)
     345     .             - trans(jl,ja,lwxn_ncouche+1,nj)
    339346     .             + trans(jl,ja,1,nj) )
    340347     .             * (cb(nj)*dp(jl,jk+1)) * 2
     
    369376        enddo
    370377
    371         do ni = 1 ,ncouche
     378        do ni = 1 ,lwxn_ncouche
    372379          do ja = 1 ,nuco2
    373380              do jl = 1 , kdlon
    374381
    375382      xi_ground(ig0+jl,ja) = xi_ground(ig0+jl,ja)
    376      .                     + ( trans(jl,ja,ni+1,ncouche+1)
    377      .                        -trans(jl,ja,ni,ncouche+1))
     383     .                     + ( trans(jl,ja,ni+1,lwxn_ncouche+1)
     384     .                        -trans(jl,ja,ni,lwxn_ncouche+1))
    378385     .                     * 2 * cb(ni)
    379386            enddo
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r4058 r4060  
    109109      use phyetat0_mod, only: phyetat0, tab_cntrl_mod
    110110      use wstats_mod, only: callstats, wstats, mkstats
    111       use eofdump_mod, only: eofdump
    112111      USE vertical_layers_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt
    113112      USE mod_phys_lmdz_omp_data, ONLY: is_omp_master
     
    137136      use callkeys_mod, only: calladj, calltherm, callatke, calldifv
    138137      use callkeys_mod, only: callrichsl, tke_heat_flux
    139       use callkeys_mod, only: calllott, calllott_nonoro, calleofdump
     138      use callkeys_mod, only: calllott, calllott_nonoro
    140139      use callkeys_mod, only: callrad, callnlte, callnirco2, nircorr
    141140      use callkeys_mod, only: diurnal, season, iradia, nltemodel
     
    190189c           - "startfi", "histfi" (if it's time)
    191190c           - Saving statistics (if "callstats = .true.")
    192 c           - Dumping eof (if "calleofdump = .true.")
    193191c           - Output any needed variables in "diagfi"
    194192c     11. Diagnostic: mass conservation of tracers
     
    31953193           ENDIF
    31963194
    3197 c        (Store EOF for Mars Climate database software)
    3198          IF (calleofdump) THEN
    3199             CALL eofdump(ngrid, nlayer, zu, zv, zt, rho, ps)
    3200          ENDIF
    32013195#endif
    32023196!endif of ifndef MESOSCALE
Note: See TracChangeset for help on using the changeset viewer.