Changeset 3106


Ignore:
Timestamp:
Oct 26, 2023, 11:30:35 AM (20 months ago)
Author:
jbclement
Message:

PEM:

  • Correction of a bug when running with ifort, XIOS and no sub-slopes. If compiled with ifort, the 'Reshape' program cashed because of sub-slopes variables were written in the XIOS output but not filled. A new file definition without sub-slopes can be chosen in the xml file to avoid this issue.
  • Addition in the 'Reshape' program of a check to remove the output files if they exist to prevent a crash.

JBC

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3097 r3106  
    120120Following r3095, 'iniorbit' is now a subroutine of "planete_h.F90".
    121121Correction of a bug from r3088: "diagfi.nc" was not changed into "diagpem.nc" in the commited version of "writediagpem.F90"!
     122
     123== 26/10/2023 == JBC
     124    - Correction of a bug when running with ifort, XIOS and no sub-slopes. If compiled with ifort, the 'Reshape' program cashed because of sub-slopes variables were written in the XIOS output but not filled. A new file definition without sub-slopes can be chosen in the xml file to avoid this issue.
     125    - Addition in the 'Reshape' program of a check to remove the output files if they exist to prevent a crash.
  • trunk/LMDZ.COMMON/libf/evolution/reshape_XIOS_output.F90

    r3096 r3106  
    1515
    1616integer                               :: state, ncid, ncid1, ncid2, nDims, nVars, nGlobalAtts, unlimDimID
    17 integer                               :: i, j, include_parents
     17integer                               :: i, j, include_parents, cstat
    1818integer, dimension(:),    allocatable :: dimids, varids, dimids_2, varids_2, dimid_var
    1919real, dimension(:),       allocatable :: tempvalues_1d, values_1d
     
    2121real, dimension(:,:,:),   allocatable :: tempvalues_3d, values_3d
    2222real, dimension(:,:,:,:), allocatable :: tempvalues_4d, values_4d
    23 character(1)                          :: str2
     23character(1)                          :: str
    2424character(30)                         :: name_, namevar
    2525integer                               :: xtype_var, len_, len_1, len_2, len_lat, len_lon, len_time, len_soil
    2626integer                               :: dimid_lon, dimid_lat, dimid_time, dimid_soil, dimid_2, numdims, numatts, numyear
     27logical                               :: yes
    2728
    2829do numyear = 1,2
    2930    write(*,*) 'numyear',numyear
    30     write(str2(1:1),'(i1.1)') numyear
     31    write(str(1:1),'(i1.1)') numyear
    3132    !nf90_open                 ! open existing netCDF dataset
    3233    !integer :: ncid, state
    3334    !...
    34     state = nf90_open(path = "data2reshape"//str2//".nc", mode = nf90_nowrite, ncid = ncid1)
    35     if (state /= nf90_noerr) call handle_err(state)
    36 
    37     state = nf90_create(path = "data_PCM_Y"//str2//".nc", cmode=or(nf90_noclobber,nf90_64bit_offset), ncid = ncid2)
     35    state = nf90_open(path = "data2reshape"//str//".nc", mode = nf90_nowrite, ncid = ncid1)
     36    if (state /= nf90_noerr) call handle_err(state)
     37
     38    inquire(file = 'data_PCM_Y'//str//'.nc', exist = yes)
     39    if (yes) then
     40        call execute_command_line('rm data_PCM_Y'//str//'.nc',cmdstat = cstat)
     41        if (cstat > 0) then
     42            error stop 'Command exection failed!'
     43        else if (cstat < 0) then
     44            error stop 'Command execution not supported!'
     45        endif
     46    endif
     47    state = nf90_create(path = "data_PCM_Y"//str//".nc", cmode=or(nf90_noclobber,nf90_64bit_offset), ncid = ncid2)
    3848    if (state /= nf90_noerr) call handle_err(state)
    3949
  • trunk/LMDZ.MARS/deftank/file_def_physics_mars.xml

    r3038 r3106  
    8181        </file>
    8282
    83         <!-- FILE 3 :diurnal averages outputs for PEM; output_freq is every day -->
     83        <!-- FILE 3 :diurnal averages outputs for PEM without sub-slope; output_freq is every day -->
    8484        <file id="diurnalave"
    8585              name="Xdiurnalave"
     
    8888              time_units="days"
    8989              enabled=".true.">
     90                   
     91            <!-- VARS 0D -->
     92            <field_group operation="average"
     93                         freq_op="1ts">
     94                <field field_ref="Ls" />
     95            </field_group>
     96
     97            <field_group operation="average"
     98                         freq_op="1ts">
     99                <field field_ref="area" operation="once" />
     100                <field field_ref="ps" />
     101                <field field_ref="tsurf" />
     102                <field field_ref="Waterdensity_surface" />
     103                <field field_ref="h2o_layer1" />
     104                <field field_ref="co2_layer1" />
     105                <field field_ref="fluxsurf_dn_sw" name="ISR" />
     106                <field field_ref="fluxtop_dn_sw" name="insolation" />
     107            </field_group>
     108
     109            <field_group operation="minimum"
     110                         freq_op="1ts">
     111                <field field_ref="co2ice" />
     112                <field field_ref="h2o_ice_s" />
     113                <field field_ref="watercap" />
     114            </field_group>
     115
     116            <!-- VARS soil -->
     117            <field_group operation="average"
     118                         freq_op="1ts">
     119                <field field_ref="soiltemp" />
     120                <field field_ref="Waterdensity_soil" />
     121            </field_group>
     122        </file>
     123
     124        <!-- FILE 4 :diurnal averages outputs for PEM with sub-slopes; output_freq is every day -->
     125        <file id="diurnalave_s"
     126              name="Xdiurnalave_s"
     127              output_freq="1d"
     128              type="one_file"
     129              time_units="days"
     130              enabled=".false.">
    90131                   
    91132            <!-- VARS 0D -->
     
    107148                <field field_ref="tsurf_slope06" />
    108149                <field field_ref="tsurf_slope07" />
     150                <field field_ref="Waterdensity_surface" />
    109151                <field field_ref="Waterdensity_surface01" />
    110152                <field field_ref="Waterdensity_surface02" />
     
    138180                <field field_ref="h2o_ice_s_slope06" />
    139181                <field field_ref="h2o_ice_s_slope07" />
     182                <field field_ref="watercap" />
    140183                <field field_ref="watercap_slope01" />
    141184                <field field_ref="watercap_slope02" />
     
    158201                <field field_ref="soiltemp_slope06" />
    159202                <field field_ref="soiltemp_slope07" />
     203                <field field_ref="Waterdensity_soil" />
    160204                <field field_ref="Waterdensity_soil_slope01" />
    161205                <field field_ref="Waterdensity_soil_slope02" />
  • trunk/LMDZ.MARS/deftank/pem/launch_pem.sh

    r3096 r3106  
    167167    # Copy data files and prepare the next run
    168168    mv out_runPEM${iPEM} out_PEM/run${iPEM}
    169     mv diagpem.nc diags/diagpem_${iPEM}.nc
    170     cp restartpem.nc starts/startpem_${iPEM}.nc
     169    mv diagpem.nc diags/diagpem${iPEM}.nc
     170    cp restartpem.nc starts/startpem${iPEM}.nc
    171171    mv restartpem.nc startpem.nc
    172172    cp restartfi_evol.nc starts/startfi_postPEM${iPEM}.nc
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r3098 r3106  
    38903890        ENDDO
    38913891
     3892      CALL write_output("Waterdensity_soil",
     3893     &     "rhowater_soil",'kg.m-3',
     3894     &     rhowater_soil(:,:,iflat))
     3895      CALL write_output("Waterdensity_surface",
     3896     &     "rhowater_surface",'kg.m-3',
     3897     &     rhowater_surf(:,iflat))
    38923898      DO islope = 1,nslope
    38933899        write(str2(1:2),'(i2.2)') islope
  • trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F

    r3098 r3106  
    10781078c             pdqsdif > 0 : ice condensing
    10791079c             pdqsdif < 0 : ice subliming
    1080              write(*,*) "subliming more than available frost:  qsurf!"
     1080c             write(*,*) "subliming more than available frost:  qsurf!"
    10811081                  zdqsdif(ig)=
    10821082     &                        -zqsurf(ig)/subtimestep
Note: See TracChangeset for help on using the changeset viewer.