Ignore:
Timestamp:
Apr 30, 2025, 5:54:42 PM (3 months ago)
Author:
afalco
Message:

Pluto: write restartfi during the run, not just at the end. It is written every diagfi_output_rate.
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3749 r3750  
    406406      REAL zdum2(ngrid,nlayer)
    407407      real ztim1,ztim2,ztim3, z1,z2
    408       real ztime_fin
     408      real ztime_restart
    409409      real zdh(ngrid,nlayer)
    410410      real gmplanet
     
    490490      logical, save ::  check_physics_outputs=.false.
    491491!$OPM THREADPRIVATE(check_physics_inputs,check_physics_outputs)
     492      LOGICAL write_restartfi
    492493
    493494      ! Misc
     
    19811982      if (is_master) print*,'--> Ls =',zls*180./pi
    19821983
     1984      write_restartfi = .false.
    19831985      if(lastcall) then
    1984          IF (grid_type==unstructured) THEN !IF DYNAMICO
    1985             ! DYNAMICO: no need to add a dynamics time step to ztime_fin
    1986             ztime_fin = ptime
    1987          ELSE ! LMDZ
    1988             ztime_fin = ptime + ptimestep/(float(iphysiq)*daysec)
    1989          ENDIF ! of IF (grid_type==unstructured)
    1990          !! Update surface ice distribution to iterate to steady state if requested
    1991          !! AF24: removed
    1992 
    1993          ! endif
     1986         write_restartfi = .true.
     1987
    19941988         if (paleo) then
    19951989            ! time range for tendencies of ice flux qsurfyear
     
    20722066            if (is_master) write(*,*) "Paleo eccpal=",eccpal,"  tpal=",tpalnew
    20732067
     2068            ! create restartfi
     2069            if (ngrid.ne.1) then
     2070               print*, "physdem1pal not yet implemented"
     2071               stop
     2072               !TODO: import this routine from pluto.old
     2073               ! call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
     2074               !      ptimestep,pdaypal, &
     2075               !      ztime_restart,tsurf,tsoil,emis,q2,qsurfpal, &
     2076               !      cell_area,albedodat,therm_inertia,zmea,zstd,zsig, &
     2077               !      zgam,zthe,oblipal,eccpal,tpalnew,adjustnew,phisfipal,  &
     2078               !      peri_daypal)
     2079            endif
     2080         else ! 'paleo'
     2081
     2082
     2083         endif ! end of 'paleo'
     2084      endif ! end of 'lastcall'
     2085
     2086      if(mod(icount,diagfi_output_rate).eq.0) then
     2087         write_restartfi = .true.
     2088      endif
    20742089!----------------------------------------------------------------------
    20752090!        Writing NetCDF file  "RESTARTFI" at the end of the run
     
    20812096!              thus we store for time=time+dtvr
    20822097
    2083             ! create restartfi
    2084             if (ngrid.ne.1) then
    2085                print*, "physdem1pal not yet implemented"
    2086                stop
    2087                !TODO: import this routine from pluto.old
    2088                ! call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
    2089                !      ptimestep,pdaypal, &
    2090                !      ztime_fin,tsurf,tsoil,emis,q2,qsurfpal, &
    2091                !      cell_area,albedodat,therm_inertia,zmea,zstd,zsig, &
    2092                !      zgam,zthe,oblipal,eccpal,tpalnew,adjustnew,phisfipal,  &
    2093                !      peri_daypal)
    2094             endif
    2095          else ! 'paleo'
    2096 
    2097             if (ngrid.ne.1) then
    2098                write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
    2099 
    2100                call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
    2101                            ptimestep,ztime_fin,tsurf,                &
    2102                            tsoil,therm_inertia,emis,albedo,q2,qsurf)
    2103             endif
    2104 
    2105          endif ! end of 'paleo'
    2106       endif ! end of 'lastcall'
     2098      if (is_omp_master.and.write_restartfi) then
     2099         if (ngrid.ne.1) then
     2100            IF (grid_type==unstructured) THEN !IF DYNAMICO
     2101               ! DYNAMICO: no need to add a dynamics time step to ztime_restart
     2102               ztime_restart = ptime
     2103            ELSE ! LMDZ
     2104               ztime_restart = ptime + (ptimestep/daysec)
     2105            ENDIF ! of IF (grid_type==unstructured)
     2106
     2107            write(*,*)'PHYSIQ: writing restartfi at time =',ztime_restart
     2108
     2109            call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
     2110                        ptimestep,ztime_restart,tsurf,                &
     2111                        tsoil,therm_inertia,emis,albedo,q2,qsurf)
     2112         endif ! ngrid
     2113      endif ! is_omp_master
     2114
     2115
    21072116
    21082117!------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.