Changeset 3698 for trunk


Ignore:
Timestamp:
Mar 26, 2025, 11:05:58 AM (5 months ago)
Author:
emillour
Message:

Pluto PCM:
Some fixes to enable runnnig with dynamico:

  • add "strictboundcorrk" flag in callcorrk_pluto to enable running even if outside of kmatrix temperatures (when strictboundcorrk=.true.)
  • add premature exiting of writediagsoil if not with lon-lat grid
  • while at it, turned surfprop.F90 into a module
  • in physiq, enforce the possibility to output subsurface-related field in most cases, not only when "fast=.true."
  • adapt reference xml files: subsurface quantities need to be defined on a dedicated grid, otherwise XIOS will generate misleading garbage values. Updated files are put in "deftank/dynamico" for now.

EM

Location:
trunk/LMDZ.PLUTO
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/changelog.txt

    r3196 r3698  
    18421842== 31/01/2024 == AF
    18431843Included N2 condensation from PLUTO.old & read haze aerosols.
     1844
     1845...lots of missing stuff here...
     1846
     1847== 26/03/2025 == EM
     1848Some fixes to enable runnnig with dynamico:
     1849- add "strictboundcorrk" flag in callcorrk_pluto to enable running
     1850  even if outside of kmatrix temperatures (when strictboundcorrk=.true.)
     1851- add premature exiting of writediagsoil if not with lon-lat grid
     1852- while at it, turned surfprop.F90 into a module
     1853- in physiq, enforce the possibility to output subsurface-related field
     1854  in most cases, not only when "fast=.true."
     1855- adapt reference xml files: subsurface quantities need to be defined
     1856  on a dedicated grid, otherwise XIOS will generate misleading garbage values.
     1857  Updated files are put in "deftank/dynamico" for now.
     1858
  • trunk/LMDZ.PLUTO/deftank/dynamico/context_pcm_physics.xml

    r3544 r3698  
    1010
    1111    </domain_definition>
    12 
    13     <domain_definition>
    14         <domain id="dom_64_48" type="rectilinear" ni_glo="64" nj_glo="48"   >
    15           <generate_rectilinear_domain/>
    16           <interpolate_domain order="1"/>
    17         </domain>
    18 
    19         <domain id="dom_96_95" type="rectilinear"  ni_glo="96" nj_glo="95"  >
    20           <generate_rectilinear_domain/>
    21           <interpolate_domain order="1"/>
    22         </domain>
    23 
    24         <domain id="dom_144_142" type="rectilinear" ni_glo="144" nj_glo="142"   >
    25           <generate_rectilinear_domain/>
    26           <interpolate_domain order="1"/>
    27         </domain>
    28 
    29         <domain id="dom_512_360" type="rectilinear" ni_glo="512" nj_glo="360"   >
    30           <generate_rectilinear_domain/>
    31           <interpolate_domain order="1"/>
    32         </domain>
    33 
    34         <domain id="dom_720_360" type="rectilinear" ni_glo="720" nj_glo="360" >
    35           <generate_rectilinear_domain/>
    36           <interpolate_domain order="1"/>
    37         </domain>
    38 
    39         <domain id="dom_128_96" type="rectilinear" ni_glo="128" nj_glo="96" >
    40           <generate_rectilinear_domain/>
    41           <interpolate_domain order="1"/>
    42         </domain>
    43 
    44         <domain id="dom_256_192" type="rectilinear" ni_glo="256" nj_glo="192" >
    45           <generate_rectilinear_domain/>
    46           <interpolate_domain order="1"/>
    47         </domain>
    48 
    49         <domain id="dom_out" domain_ref="dom_128_96"/>
    50     </domain_definition>
    51     <!-- <domain_definition src="./domain_def.xml"/> -->
    5212
    5313    <!-- Definition of vertical axes
     
    9959            <axis axis_ref="altitude" />
    10060        </grid>
     61        <grid id="grid_soil">
     62            <domain domain_ref="dom_glo" />
     63            <axis axis_ref="soil_layers" />
     64        </grid>
    10165        <grid id="grid_2D">
    10266            <domain domain_ref="dom_glo" />
     
    12589            <domain domain_ref="dom_out" />
    12690        </grid>
     91        <grid id="grid_soil_out">
     92            <domain domain_ref="dom_out" />
     93            <axis axis_ref="soil_layers" />
     94        </grid>
    12795        <!--added for diagspecIR-->
    12896        <grid id="grid_IR_3D_out">
     
    143111    </grid_definition>
    144112
     113    <!-- various predefined grids to output onto -->
     114    <domain_definition>
     115        <domain id="dom_64_48" type="rectilinear" ni_glo="64" nj_glo="48"   >
     116          <generate_rectilinear_domain/>
     117          <interpolate_domain order="1"/>
     118        </domain>
     119
     120        <domain id="dom_96_95" type="rectilinear"  ni_glo="96" nj_glo="95"  >
     121          <generate_rectilinear_domain/>
     122          <interpolate_domain order="1"/>
     123        </domain>
     124
     125        <domain id="dom_144_142" type="rectilinear" ni_glo="144" nj_glo="142"   >
     126          <generate_rectilinear_domain/>
     127          <interpolate_domain order="1"/>
     128        </domain>
     129
     130        <domain id="dom_512_360" type="rectilinear" ni_glo="512" nj_glo="360"   >
     131          <generate_rectilinear_domain/>
     132          <interpolate_domain order="1"/>
     133        </domain>
     134
     135        <domain id="dom_720_360" type="rectilinear" ni_glo="720" nj_glo="360" >
     136          <generate_rectilinear_domain/>
     137          <interpolate_domain order="1"/>
     138        </domain>
     139
     140        <domain id="dom_128_96" type="rectilinear" ni_glo="128" nj_glo="96" >
     141          <generate_rectilinear_domain/>
     142          <interpolate_domain order="1"/>
     143        </domain>
     144
     145        <domain id="dom_256_192" type="rectilinear" ni_glo="256" nj_glo="192" >
     146          <generate_rectilinear_domain/>
     147          <interpolate_domain order="1"/>
     148        </domain>
     149
     150        <!-- set dom_out to any of the reference grid above,
     151              or dom_glo to output on native grid -->
     152        <domain id="dom_out" domain_ref="dom_128_96"/>
     153
     154    </domain_definition>
     155
     156
    145157    <!-- Definition of model variables -->
    146158    <field_definition src="./field_def_physics.xml" />
  • trunk/LMDZ.PLUTO/deftank/dynamico/field_def_physics.xml

    r3607 r3698  
    5858                     unit="cm-1"/>
    5959       </field_group>
     60
    6061        <!-- 2D variables -->
    6162        <field_group id="fields_2D" grid_ref="grid_2D">
     
    8081                   unit="K" />
    8182
     83            <field id="capcal"
     84                   long_name="Surface Heat Capacity"
     85                   unit="W.s m-2 K-1" />
     86            <field id="fluxrad"
     87                   long_name="fluxrad"
     88                   unit="W m-2" />
     89
    8290            <!-- Tracers -->
    8391            <field id="n2_surf"
     
    155163                   long_name="zdqssed haze"
    156164                   unit="" />
     165            <field id="zdtsdif"
     166                   long_name="tendency zdtsdif"
     167                   unit="K s-1" />
     168            <field id="zdtsurfc"
     169                   long_name="tendancy Ts cond N2"
     170                   unit="K s-1" />
     171            <field id="zdqsc_n2"
     172                   long_name="tendancy tracer surf cond N2"
     173                   unit="kg kg-1 s-1" />
     174            <field id="zdqsdif_n2"
     175                   long_name="tendancy tracer surf diff"
     176                   unit="kg kg-1 s-1" />
    157177
    158178            <!-- Radiation -->
     
    260280                   long_name="Dyn. heating"
    261281                   unit="T s-1" />
     282            <field id="zdudyn"
     283                   long_name="Dyn. U"
     284                   unit="m s-2" />
     285            <field id="zdtconduc"
     286                   long_name="tendency conduc"
     287                   unit="K s-1" />
     288            <field id="zdumolvis"
     289                   long_name="tendency umolvis"
     290                   unit="m s-1" />
     291            <field id="zdvmolvis"
     292                   long_name="tendency vmolvis"
     293                   unit="m s-1" />
    262294            <field id="dtmoistadj"
    263295                   long_name="moist adj heating"
     
    265297            <field id="dtdryadj"
    266298                   long_name="dry adj heating"
     299                   unit="K s-1" />
     300            <field id="zdtdif"
     301                   long_name="tendancy T diff"
     302                   unit="K s-1" />
     303            <field id="zdtadj"
     304                   long_name="tendancy T adj"
    267305                   unit="K s-1" />
    268306
     
    292330                   long_name="tendancy T cond N2"
    293331                   unit="K" />
     332            <field id="zduc"
     333                   long_name="tendancy U cond N2"
     334                   unit="m s-1" />
     335            <field id="zdvc"
     336                   long_name="tendancy V cond N2"
     337                   unit="m s-1" />
     338            <field id="zdqc_n2"
     339                   long_name="tendancy tracer cond N2"
     340                   unit="kg kg-1 s-1" />
     341            <field id="zdqdif_n2"
     342                   long_name="tendancy tracer diff"
     343                   unit="kg kg-1 s-1" />
     344            <field id="zdqadj_n2"
     345                   long_name="tendancy tracer adj"
     346                   unit="K s-1" />
    294347
    295348            <field id="zrho_ch4"
     
    342395                   long_name="zdqconv_prec"
    343396                   unit="" />
    344 
    345         </field_group>
     397            <field id='haze_reff'
     398                   long_name='haze_reff'
     399                   unit='m' />
     400
     401            <field id="dtauv_01"
     402                   long_name="Layer optical thickness attenuation in VI band"
     403                   unit="" />
     404            <field id="dtauv_23"
     405                   long_name="Layer optical thickness attenuation in VI band"
     406                   unit="" />
     407            <field id="dtaui_01"
     408                   long_name="Layer optical thickness attenuation in IR band"
     409                   unit="" />
     410            <field id="dtaui_17"
     411                   long_name="Layer optical thickness attenuation in IR band"
     412                   unit="" />
     413
     414        </field_group>
     415
     416
     417        <field_group id="fields_soil" grid_ref="grid_soil">
     418
     419            <field id="tsoil"
     420                   long_name="Soil Temperature"
     421                   unit="K" />
     422            <field id="therm_inertia"
     423                   long_name="Soil Thermal Inertia"
     424                   unit="S.I." />
     425
     426        </field_group>
     427
    346428
    347429        <!--Spectral IR 3D variables-->
  • trunk/LMDZ.PLUTO/deftank/dynamico/file_def_physics.xml

    r3544 r3698  
    1515        <file id="histins"
    1616              name="Xhistins"
    17               output_freq="1ts"
    18               sync_freq="1ts"
     17              output_freq="20ts"
     18              sync_freq="20ts"
    1919              type="one_file"
    2020              time_units="days"
     
    3939                  <field field_ref="area" operation="once" />
    4040                  <field field_ref="ps" enabled="true" />
     41                  <field field_ref="tsurf" enabled="true" />
     42                  <field field_ref="ALB" enabled="true" />
     43                  <field field_ref="emis" enabled="true" />
    4144                  <field field_ref="ISR" enabled="true" />
    4245                  <field field_ref="OLR" enabled="true" />
    4346                  <field field_ref="ASR" enabled="true" />
     47                  <field field_ref="n2_surf" enabled="true" />
     48                  <field field_ref="ch4_ice_surf" enabled="true" />
     49                  <field field_ref="co_ice_surf" enabled="true" />
    4450              </field_group>
    4551
     
    6571                  <field field_ref="entr" /-->
    6672              </field_group>
     73             
     74              <field_group operation="instant"
     75                           grid_ref="grid_soil_out"
     76                           freq_op="1ts">
     77                  <field field_ref="tsoil" />
     78              </field_group>
     79             
    6780
    6881            <!--</field_group>-->
    6982        </file>
     83
    7084       <!--XspecIR-->
    7185      <file id="specIR"
     
    94108          </field_group>
    95109      </file>
     110
    96111       <!--XspecVI-->
    97112      <file id="specVI"
     
    100115            type="one_file"
    101116            time_units="days"
    102             enabled="true">
     117            enabled="false">
    103118          <!--Var 1D -->
    104119          <field_group operation="instant"
  • trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90

    r3685 r3698  
    2828                              strobel,vmrch4_proffix,specOLR,vmrch4fix,&
    2929                              haze_radproffix,callmufi
     30      use callkeys_mod, only: strictboundcorrk
    3031      use optcv_pluto_mod, only: optcv_pluto
    3132      use optci_pluto_mod, only: optci_pluto
     
    210211      real,save :: levdat(Nfine),vmrdat(Nfine)
    211212      real :: vmrch4(ngrid,nlayer)              ! vmr ch4 from vmrch4_proffix
     213      character(len=100) :: message
     214      character(len=15),parameter :: subname="callcorrk_pluto"
    212215
    213216!=======================================================================
     
    634637          if(tlevrad(k).lt.tgasmin)then
    635638            print*,'Minimum temperature is outside the radiative'
    636             print*,'transfer kmatrix bounds, exiting.'
     639            print*,'transfer kmatrix bounds'
    637640            print*,'t(',k,')=',tlevrad(k),' < ',tgasmin
    638             ! call abort
     641            if (strictboundcorrk) then
     642              message="Minimum temperature outside of kmatrix bounds"
     643              call abort_physic(subname,message,1)
     644            else
     645              print*,'***********************************************'
     646              print*,'we allow model to continue with tlevrad<tgasmin'
     647              print*,'  ... we assume we know what you are doing ... '
     648              print*,'  ... but do not let this happen too often ... '
     649              print*,'***********************************************'
     650            endif
    639651          elseif(tlevrad(k).gt.tgasmax)then
    640652            print*,'Maximum temperature is outside the radiative'
    641             print*,'transfer kmatrix bounds, exiting.'
     653            print*,'transfer kmatrix bounds'
    642654            print*,'t(',k,')=',tlevrad(k),' > ',tgasmax
    643             ! call abort
     655            if (strictboundcorrk) then
     656              message="Maximum temperature outside of kmatrix bounds"
     657              call abort_physic(subname,message,1)
     658            else
     659              print*,'***********************************************'
     660              print*,'we allow model to continue with tlevrad>tgasmax'
     661              print*,'  ... we assume we know what you are doing ... '
     662              print*,'  ... but do not let this happen too often ... '
     663              print*,'***********************************************'
     664            endif
    644665          endif
    645666         enddo
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3695 r3698  
    7070      use callcorrk_mod, only: callcorrk
    7171      use callcorrk_pluto_mod, only: callcorrk_pluto
     72      use surfprop_mod, only: surfprop
    7273      use vdifc_mod, only: vdifc
    7374      use vdifc_pluto_mod, only: vdifc_pluto
     
    19581959 !     Info about Ls, declin...
    19591960      IF (fast) THEN
    1960          if (is_master) write(*,*),'Ls=',zls*180./pi,' dec=',declin*180./pi
    1961          if (is_master) write(*,*),'zday=',zday,' ps=',globave
     1961         if (is_master) write(*,*)'Ls=',zls*180./pi,' dec=',declin*180./pi
     1962         if (is_master) write(*,*)'zday=',zday,' ps=',globave
    19621963         IF (lastcall) then
    1963             if (is_master) write(*,*),'lastcall'
     1964            if (is_master) write(*,*)'lastcall'
    19641965         ENDIF
    19651966      ELSE
    1966          if (is_master) write(*,*),'Ls=',zls*180./pi,'decli=',declin*180./pi,'zday=',zday
     1967         if (is_master) write(*,*)'Ls=',zls*180./pi,'decli=',declin*180./pi,'zday=',zday
    19671968      ENDIF
    19681969
     
    21392140      if (fast) then
    21402141         call write_output("fluxrad","fluxrad","W m-2",fluxrad)
    2141          call write_output("fluxgrd","fluxgrd","W m-2",fluxgrd)
    21422142         ! call write_output("dplanck","dplanck","W.s m-2 K-1",dplanck)
     2143      endif
     2144
     2145      if (callsoil) then
    21432146         ! "soil" variables
    2144          call write_output("capcal","capcal","W.s m-2 K-1",capcal)
     2147         call write_output("capcal","Surface Heat Capacity","W.s m-2 K-1",capcal)
    21452148         call write_output("tsoil","tsoil","K",tsoil)
    21462149         call write_output("therm_inertia","therm_inertia","S.I.",therm_inertia)
  • trunk/LMDZ.PLUTO/libf/phypluto/surfprop.F90

    r3539 r3698  
     1module surfprop_mod
     2
     3implicit none
     4
     5contains
     6
    17      subroutine surfprop(ngrid,nq,pfra,qsurf,tsurface,       &
    28                     capcal,adjust,dist,fluold,ptimestep,zls, &
     
    507513      end subroutine surfprop
    508514
     515end module surfprop_mod
  • trunk/LMDZ.PLUTO/libf/phypluto/writediagsoil.F90

    r3506 r3698  
    2323use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    2424use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo, &
    25                               nbp_lon, nbp_lat
     25                              nbp_lon, nbp_lat, &
     26                              grid_type, unstructured
    2627
    2728implicit none
     
    7879real px2(ngrid)
    7980#endif
     81
     82! 0. This routine shoul only be used in lon-lat case
     83if (grid_type==unstructured) then
     84  return
     85endif
    8086
    8187! 1. Initialization step
Note: See TracChangeset for help on using the changeset viewer.