Changeset 3586 for trunk


Ignore:
Timestamp:
Jan 20, 2025, 10:31:40 AM (5 months ago)
Author:
jbclement
Message:

Mars PCM:

  • Albedo is now set properly in every situation given the presence of CO2/H2O ice and frost + water albedo is done solely in "physiq".
  • Small update to make the display of code version status/diff clearer.

JBC

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r3578 r3586  
    611611vcs_info=""
    612612vcs_diff=""
    613 vcs_status=""
     613vcs_stat=""
    614614for dir in "$LMDGCM/.."/*; do
    615615    # Skip if it is not a directory or the name contains "git" or "svn"
     
    619619    # Determine the version control system for each subdirectory
    620620    if command -v svn > /dev/null && svn info "$dir" > /dev/null 2>&1; then # SVN
    621         vcs_info+="\n=== SVN Information for $(basename "$dir") ===\n$(svn info "$dir")\n"
    622         vcs_diff+="\n=== SVN Diff for $(basename "$dir") ===\n$(svn diff "$dir")\n"
    623         vcs_status+="\n=== SVN Status for $(basename "$dir") ===\n$(svn status "$dir")\n"
     621        vcs_info+="\n-> SVN Information for \"$(basename "$dir")\"\n$(svn info "$dir")\n"
     622        vcs_diff+="\n-> SVN Diff for \"$(basename "$dir")\"\n$(svn diff "$dir")\n"
     623        vcs_stat+="\n-> SVN Status for \"$(basename "$dir")\"\n$(svn status "$dir")\n"
    624624    elif command -v git > /dev/null && git -C "$dir" rev-parse --is-inside-work-tree > /dev/null 2>&1; then # Git
    625         vcs_info+="=== Git Information for $(basename "$dir") ===\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s")\n"
    626         vcs_diff+="\n=== Git Diff for $(basename "$dir") ===\n$(git -C "$dir" diff)\n"
    627         vcs_status+="\n=== Git Status for $(basename "$dir") ===\n$(git -C "$dir" status --short)\n"
     625        vcs_info+="-> Git Information for \"$(basename "$dir")\"\n$(git -C "$dir" log -1 --pretty=format:"%H%n%an%n%ad%n%s")\n"
     626        vcs_diff+="\n-> Git Diff for \"$(basename "$dir")\"\n$(git -C "$dir" diff)\n"
     627        vcs_stat+="\n-> Git Status for \"$(basename "$dir")\"\n$(git -C "$dir" status --short)\n"
    628628    else # None
    629         vcs_info+="\n=== No version control system for $(basename "$dir") ===\n"
     629        vcs_info+="\n-> No version control system for \"$(basename "$dir")\"\n"
    630630    fi
    631631done
     
    659659
    660660write(*,'(a)') '======= Compilation details ======='
    661 write(*,'(a)') '> Date: ${current_date}'
    662 write(*,'(a)') '> Command: ${compilation_command}'
     661write(*,'(a)') '-> Date: ${current_date}'
     662write(*,'(a)') '-> Command: ${compilation_command}'
    663663write(*,*)
    664664EOF
     
    670670    done <<< "$(echo -e "$vcs_info")"
    671671else
    672     echo "write(*,'(a)') '=== No version control system ==='" >> "$info_file"
    673 fi
    674 
    675 if [ -n "$vcs_status" ]; then
     672    echo "write(*,'(a)') '==== No version control system ===='" >> "$info_file"
     673fi
     674
     675if [ -n "$vcs_stat" ]; then
    676676    echo "write(*,*)" >> "$info_file"
    677     echo "write(*,'(a)') '=== Version Control Status ==='" >> "$info_file"
    678     echo "write(*,'(a)') '> Writing status result to the file \"${res_file}\".'" >> "$info_file"
     677    echo "write(*,'(a)') '====== Version Control Status ====='" >> "$info_file"
     678    echo "write(*,'(a)') '-> Writing status result to the file \"${res_file}\".'" >> "$info_file"
    679679    echo "open(unit = 1, file = \"${res_file}\",status = 'replace',action = 'write')" >> "$info_file"
    680680    while IFS= read -r line; do
    681681        echo "write(1,'(a)') '${line//\'/\'\'}'" >> "$info_file"
    682     done <<< "$(echo -e "$vcs_status")"
     682    done <<< "$(echo -e "$vcs_stat")"
    683683    echo "close(1)" >> "$info_file"
    684684fi
     
    687687    echo "write(*,*)" >> "$info_file"
    688688    echo "write(*,'(a)') '====== Version Control Diff ======='" >> "$info_file"
    689     echo "write(*,'(a)') '> Writing diff result to the file \"${res_file}\".'" >> "$info_file"
     689    echo "write(*,'(a)') '-> Writing diff result to the file \"${res_file}\".'" >> "$info_file"
    690690    echo "open(unit = 1, file = \"${res_file}\",status = 'unknown',position = 'append',action = 'write')" >> "$info_file"
    691691    while IFS= read -r line; do
  • trunk/LMDZ.MARS/changelog.txt

    r3582 r3586  
    47604760- Correction of r3581: the key-words to get 'albedo_perennialco2(1:2)" from the "callphys.def" are now 'albedo_perennialco2_north' and 'albedo_perennialco2_south'.
    47614761- Moving 'albedo_perennialco2' from the 'paleoclimate' module to the 'surfdat_h' module.
     4762
     4763== 20/01/2025 == JBC
     4764- Albedo is now set properly in every situation given the presence of CO2/H2O ice and frost + water albedo is done solely in "physiq".
     4765- Small update to make the display of code version status/diff clearer.
  • trunk/LMDZ.MARS/libf/phymars/albedocaps.F90

    r3582 r3586  
    66use ioipsl_getin_p_mod, only: getin_p
    77use geometry_mod, only: latitude ! grid point latitudes (rad)
    8 use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef,       &
    9                      emisice, albedice, watercaptag, albedo_h2o_cap, &
    10                      emissiv, albedodat, albedo_perennialco2
     8use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef, &
     9                     emisice, emissiv, albedice, albedodat, albedo_perennialco2
    1110USE mod_phys_lmdz_transfert_para, ONLY: bcast
    1211USE mod_phys_lmdz_para, ONLY: is_master
     
    9695        icap = 1 ! Northern hemisphere
    9796    endif
    98 
    99     if (piceco2(ig) > 0) then ! CO2 frost
     97   
     98    ! Initialization with bare ground
     99    ! set emissivity of surface to be bare ground emissivity
     100    emisref(ig) = emissiv
     101    ! set the surface albedo to bare ground albedo
     102    psolaralb(ig,:) = albedodat(ig)
     103
     104    ! CO2 perennial ice
     105    if (paleoclimate .and. piceco2_peren(ig) > 0.) then
     106        psolaralb(ig,:) = albedo_perennialco2(icap)
     107        emisref(ig) = emisice(icap)
     108    endif
     109    ! CO2 frost
     110    if (piceco2(ig) > 0.) then
    100111        ! set emissivity of surface to be the ice emissivity
    101112        emisref(ig) = emisice(icap)
     
    105116            psolaralb(ig,2) = psolaralb(ig,1)
    106117        else
    107             psolaralb(ig,1) = albedice(icap)
    108             psolaralb(ig,2) = albedice(icap)
     118            psolaralb(ig,:) = albedice(icap)
    109119        endif
    110     else if (paleoclimate .and. piceco2_peren(ig) > 0.) then ! CO2 perennial ice
    111         psolaralb(ig,1) = albedo_perennialco2(icap)
    112         psolaralb(ig,2) = albedo_perennialco2(icap)
    113         emisref(ig) = emisice(icap)
    114     else if (watercaptag(ig) .and. water) then ! H2O ice in polar caps
    115         ! there is a water ice cap: set the surface albedo to the water ice one
    116         ! to do : emissivity
    117         emisref(ig) = 1
    118         psolaralb(ig,:) = albedo_h2o_cap
    119     else ! Bare ground
    120         ! set emissivity of surface to be bare ground emissivity
    121         emisref(ig) = emissiv
    122         ! set the surface albedo to bare ground albedo
    123         psolaralb(ig,:) = albedodat(ig)
    124     endif ! of if (piceco2(ig).gt.0)
     120    endif
    125121enddo ! of ig=1,ngrid
    126122
  • trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F

    r3262 r3586  
    612612        alb_tmp = psolaralb(:,:,islope)
    613613        emisref_tmp = 0.
    614         perennial_co2ice_tmp =  perennial_co2ice(:,islope) 
     614        perennial_co2ice_tmp =  perennial_co2ice(:,islope)
    615615        CALL albedocaps(zls,ngrid,piceco2_tmp,perennial_co2ice_tmp,
    616616     &                  alb_tmp,emisref_tmp)
    617617        perennial_co2ice(:,islope) = perennial_co2ice_tmp
    618         psolaralb(:,1,islope) =  alb_tmp(:,1)
    619         psolaralb(:,2,islope) =  alb_tmp(:,2)
     618        psolaralb(:,:,islope) =  alb_tmp(:,:)
    620619        emisref(:,islope) = emisref_tmp
    621620      ENDDO
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90

    r3549 r3586  
    140140obliquit = 25.2           ! Obliquity (deg) ~25.2
    141141eccentric = 0.0934        ! Eccentricity (0.0934)
     142Lsperi = 251.             ! Solar longitude of perihelion
    142143
    143144! Planetary Boundary Layer and Turbulence parameters
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3574 r3586  
    66use phyredem,            only: physdem0, physdem1
    77use watersat_mod,        only: watersat
    8 use tracer_mod,          only: igcm_h2o_vap, igcm_h2o_ice, igcm_co2, noms
     8use tracer_mod,          only: igcm_h2o_vap, igcm_h2o_ice, noms
    99use comcstfi_h,          only: pi, g, rcp, cpp
    10 use time_phylmdz_mod, only: daysec
     10use time_phylmdz_mod,    only: daysec
    1111use dimradmars_mod,      only: tauvis, totcloudfrac, albedo
    1212use dust_param_mod,      only: tauscaling
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r3468 r3586  
    23662366c              ALWAYS PLACE these lines after co2condens !!!
    23672367c       -------------------------------------------------------------
    2368          do ig=1,ngrid
     2368         do ig = 1,ngrid
    23692369          do islope = 1,nslope
    2370            if ((qsurf(ig,igcm_co2,islope).eq.0).and.
    2371      &        (qsurf(ig,igcm_h2o_ice,islope)
    2372      &       .gt.frost_albedo_threshold)) then
    2373              if ((watercaptag(ig)).and.(cst_cap_albedo)) then
    2374                albedo(ig,1,islope) = albedo_h2o_cap
    2375                albedo(ig,2,islope) = albedo_h2o_cap
    2376              else
    2377                albedo(ig,1,islope) = albedo_h2o_frost
    2378                albedo(ig,2,islope) = albedo_h2o_frost
    2379              endif !((watercaptag(ig)).and.(cst_cap_albedo)) then
    2380 c              write(*,*) "frost thickness", qsurf(ig,igcm_h2o_ice)
    2381 c              write(*,*) "physiq.F frost :"
    2382 c     &        ,latitude(ig)*180./pi, longitude(ig)*180./pi
     2370           if (abs(qsurf(ig,igcm_co2,islope)) < 1.e-10) then ! No CO2 frost
     2371
     2372             if (qsurf(ig,igcm_h2o_ice,islope) > frost_albedo_threshold)
     2373     & then ! There is H2O frost
     2374               if (cst_cap_albedo .and. watercaptag(ig) .and.
     2375     & abs(perennial_co2ice(ig,islope)) < 1.e-10) then ! Water cap remains unchanged by water frost deposition and no CO2 perennial ice
     2376                 albedo(ig,:,islope) = albedo_h2o_cap
     2377                 emis(ig,islope) = 1.
     2378               else
     2379                 albedo(ig,:,islope) = albedo_h2o_frost
     2380                 emis(ig,islope) = 1.
     2381               endif
     2382             else ! No H2O frost
     2383               if (abs(perennial_co2ice(ig,islope)) < 1.e-10 .and.
     2384     & watercaptag(ig)) then ! No CO2 perennial ice but there is water cap
     2385                 albedo(ig,:,islope) = albedo_h2o_cap
     2386                 emis(ig,islope) = 1.
     2387               endif
     2388             endif
     2389
    23832390           endif
    23842391          enddo ! islope
Note: See TracChangeset for help on using the changeset viewer.