Changeset 3037 for trunk


Ignore:
Timestamp:
Sep 8, 2023, 7:05:32 PM (15 months ago)
Author:
jbclement
Message:

Mars PCM:
Some code cleaning in regards of tests in 1D.
JBC

Location:
trunk/LMDZ.MARS
Files:
5 edited

Legend:

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

    r3036 r3037  
    41764176== 8/09/2023 == JBC
    41774177In testphys1D.F, "dtphys" was renamed into a local variable "dttestphys" because "dtphys" is also a variable of time_phylmdz_mod.F90. Thus, it could have been modified by the physics through the module (for ex. by tabfi.F when reading startfi.nc) and affect the dynamics which is prohibited.
     4178Some code cleaning in regards of tests in 1D.
  • trunk/LMDZ.MARS/libf/phymars/iniorbit.F

    r3010 r3037  
    6969      timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))
    7070      PRINT*,'iniorbit: Perihelion solar long. Ls (deg)=',
    71      &       360.-timeperi*180./pi
     71     &       modulo(-timeperi*180./pi,360.)
    7272
    7373      END
  • trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90

    r2999 r3037  
    634634
    635635    if (hdo) then
    636     if (txt.eq."hdo_vap") then
    637       txt="hdo_ice"
    638       write(*,*) 'phyetat0: loading surface tracer', &
     636      if (txt.eq."hdo_vap") then
     637        txt="hdo_ice"
     638        write(*,*) 'phyetat0: loading surface tracer', &
    639639                           ' hdo_ice instead of hdo_vap'
    640     endif
     640      endif
    641641    endif !hdo
    642642
     
    651651          if (.not.found) then
    652652            call abort_physic(modname, &
    653                 "phyetat0: Failed loading co2ice. there is neither the variable co2ice nor qsurf",1)
     653                "phyetat0: Failed loading co2ice. There is neither the variable co2ice nor qsurf!",1)
    654654          endif
    655655        endif
     
    663663      endif !endif co2
    664664    else !(not startphy_file)
    665       qsurf(:,iq,:)=0.
     665      qsurf(:,iq,:)=0. ! co2ice is set to 0
    666666    endif ! of if (startphy_file)
    667667    write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", &
    668668                 minval(qsurf(:,iq,:)), maxval(qsurf(:,iq,:))
    669669  enddo ! of do iq=1,nq
    670 
    671     if (txt.eq."co2") then
    672       ! We first check if co2ice exist in the startfi file (old way)
    673       ! CO2 ice cover
    674       if (startphy_file) then
    675         call get_field("co2ice",qsurf(:,iq,:),found,indextime)
    676       ! If not, we load the corresponding tracer in qsurf
    677         if (.not.found) then
    678           call get_field(txt,qsurf(:,iq,:),found,indextime)
    679           if (.not.found) then
    680             call abort_physic(modname, &
    681                 "phyetat0: Failed loading co2ice",1)
    682           endif
    683         endif
    684       else
    685        ! If we run without startfile, co2ice is set to 0
    686         qsurf(:,iq,:)=0.
    687       endif !if (startphy_file)
    688         write(*,*) "phyetat0: CO2 ice cover <co2ice> range:", &
    689             minval(qsurf(:,iq,:)), maxval(qsurf(:,iq,:))
    690     endif
    691 
    692670endif ! of if (nq.ge.1)
    693671
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r3027 r3037  
    615615         ENDIF
    616616       ENDDO
    617        PRINT*,'Flat slope for islope = ',iflat
    618        PRINT*,'corresponding criterium = ',def_slope_mean(iflat)
     617       write(*,*)'Flat slope for islope = ',iflat
     618       write(*,*)'corresponding criterium = ',def_slope_mean(iflat)
    619619
    620620#else
    621621! MESOSCALE. Supposedly everything is already set in modules.
    622622! So we just check. And we fill day_ini
    623       print*,"check: --- in physiq.F"
    624       print*,"check: rad,cpp,g,r,rcp,daysec"
    625       print*,rad,cpp,g,r,rcp,daysec
    626       PRINT*,'check: tsurf ',tsurf(1,:),tsurf(ngrid,:)
    627       PRINT*,'check: tsoil ',tsoil(1,1,:),tsoil(ngrid,nsoilmx,:)
    628       PRINT*,'check: inert ',inertiedat(1,1),inertiedat(ngrid,nsoilmx)     
    629       PRINT*,'check: midlayer,layer ', mlayer(:),layer(:)
    630       PRINT*,'check: tracernames ', noms
    631       PRINT*,'check: emis ',emis(1,:),emis(ngrid,:)
    632       PRINT*,'check: q2 ',q2(1,1),q2(ngrid,nlayer+1)
    633       PRINT*,'check: qsurf ',qsurf(1,1,:),qsurf(ngrid,nq,:)
    634       PRINT*,'check: co2ice ',qsurf(1,igcm_co2,:),qsurf(ngrid,igcm_co2,:)
     623      write(*,*)"check: --- in physiq.F"
     624      write(*,*)"check: rad,cpp,g,r,rcp,daysec"
     625      write(*,*)rad,cpp,g,r,rcp,daysec
     626      write(*,*)'check: tsurf ',tsurf(1,:),tsurf(ngrid,:)
     627      write(*,*)'check: tsoil ',tsoil(1,1,:),tsoil(ngrid,nsoilmx,:)
     628      write(*,*)'check: inert ',inertiedat(1,1),inertiedat(ngrid,nsoilmx)     
     629      write(*,*)'check: midlayer,layer ', mlayer(:),layer(:)
     630      write(*,*)'check: tracernames ', noms
     631      write(*,*)'check: emis ',emis(1,:),emis(ngrid,:)
     632      write(*,*)'check: q2 ',q2(1,1),q2(ngrid,nlayer+1)
     633      write(*,*)'check: qsurf ',qsurf(1,1,:),qsurf(ngrid,nq,:)
     634      write(*,*)'check: co2ice ',qsurf(1,igcm_co2,:),qsurf(ngrid,igcm_co2,:)
    635635      !!!
    636636      day_ini = pday
     
    716716            ENDIF ! of IF (tifeedback)
    717717         ELSE
    718             PRINT*,
     718            write(*,*)
    719719     &     'PHYSIQ WARNING! Thermal conduction in the soil turned off'
    720720            DO ig=1,ngrid
     
    24962496
    24972497      IF (lwrite) THEN
    2498          PRINT*,'Global diagnostics for the physics'
    2499          PRINT*,'Variables and their increments x and dx/dt * dt'
     2498         write(*,*)'Global diagnostics for the physics'
     2499         write(*,*)'Variables and their increments x and dx/dt * dt'
    25002500         WRITE(*,'(a6,a10,2a15)') 'Ts','dTs','ps','dps'
    25012501         WRITE(*,'(2f10.5,2f15.5)')
     
    32163216     &                  "W.m-2",fluxsurf_dn_sw_tot(:,islope))
    32173217         ENDDO
     3218         call write_output("fluxtop_dn_sw","fluxtop_dn_sw",
     3219     &                  "W.m-2",fluxtop_dn_sw(:,1) + fluxtop_dn_sw(:,2))
    32183220         call write_output("fluxtop_lw","fluxtop_lw","W.m-2",
    32193221     &                  fluxtop_lw(:))
  • trunk/LMDZ.MARS/libf/phymars/tabfi.F

    r2311 r3037  
    570570      double precision pi,degrad
    571571     
    572       parameter (pi=3.14159265358979d0)
    573       parameter (degrad=57.2957795130823d0)
     572      parameter (pi=4.d0*atan(1.d0))
     573      parameter (degrad=180.d0/pi)
    574574
    575575      e_elips=(aphelie-periheli)/(aphelie+periheli)     
Note: See TracChangeset for help on using the changeset viewer.