Changeset 3311 for trunk


Ignore:
Timestamp:
Apr 22, 2024, 4:42:50 PM (7 months ago)
Author:
yjaziri
Message:

Generic PCM:

Split open_startphy to create_restartphy and only open_startphy
will before open_startphy was doing both by create_restartphy
at firstcall

YJ

Location:
trunk/LMDZ.GENERIC
Files:
3 edited

Legend:

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

    r3309 r3311  
    19071907 (see routine "read_volcano" in volcano.F90)
    19081908
    1909 == 20/11/2023 == YJ
     1909== 22/04/2024 == YJ
    19101910- Cosmetic + clarifying some variables and comments in chemistry
    19111911- add controle variable for actinique UV flux in photochemistry
    19121912  and output surface UV flux in diagspecUV.nc
     1913
     1914== 22/04/2024 == YJ
     1915Split open_startphy to create_restartphy and only open_startphy
     1916will before open_startphy was doing both by create_restartphy
     1917at firstcall
  • trunk/LMDZ.GENERIC/libf/phystd/iostart.F90

    r3100 r3311  
    4040    PUBLIC inquire_dimension, inquire_dimension_length
    4141    PUBLIC inquire_field, inquire_field_ndims
    42     PUBLIC open_startphy,close_startphy,open_restartphy,close_restartphy
     42    PUBLIC open_startphy,close_startphy,create_restartphy,open_restartphy,close_restartphy
    4343   
    4444CONTAINS
     
    458458!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    459459
    460   SUBROUTINE open_restartphy(filename)
     460  SUBROUTINE create_restartphy(filename)
    461461  USE netcdf, only: NF90_CREATE, NF90_CLOBBER, NF90_64BIT_OFFSET, &
    462462                    NF90_NOERR, nf90_strerror, &
    463463                    NF90_PUT_ATT, NF90_GLOBAL, NF90_DEF_DIM, &
    464                     NF90_UNLIMITED, NF90_ENDDEF, &
    465                     NF90_WRITE, NF90_OPEN
     464                    NF90_UNLIMITED, NF90_ENDDEF
    466465  USE mod_phys_lmdz_para, only: is_master
    467466  USE mod_grid_phy_lmdz, only: klon_glo
     
    475474    CHARACTER(LEN=*),INTENT(IN) :: filename
    476475    INTEGER                     :: ierr
    477     LOGICAL,SAVE :: already_created=.false.
    478 !$OMP THREADPRIVATE(already_created)
    479    
    480     IF (is_master) THEN
    481       if (.not.already_created) then
    482         ! At the very first call, create the file
     476   
     477    IF (is_master) THEN
     478     
    483479        ierr=NF90_CREATE(filename,IOR(NF90_CLOBBER,NF90_64BIT_OFFSET), &
    484480                          nid_restart)
     
    488484          CALL ABORT
    489485        ENDIF
    490         already_created=.true.
    491       else
    492         ! Just open the file
    493         ierr=NF90_OPEN(filename,NF90_WRITE,nid_restart)
    494         IF (ierr/=NF90_NOERR) THEN
    495           write(*,*)'open_restartphy: problem opening file '//trim(filename)
    496           write(*,*)trim(nf90_strerror(ierr))
    497           CALL ABORT
    498         ENDIF
    499         return
    500       endif ! of if (.not.already_created)
    501486
    502487      ierr=NF90_PUT_ATT(nid_restart,NF90_GLOBAL,"title",&
     
    573558        CALL ABORT
    574559      ENDIF
     560    ENDIF
     561
     562  END SUBROUTINE create_restartphy
     563
     564  SUBROUTINE open_restartphy(filename)
     565  USE netcdf, only: NF90_OPEN, NF90_NOERR, NF90_WRITE, nf90_strerror
     566  USE mod_phys_lmdz_para, only: is_master
     567
     568  IMPLICIT NONE
     569    CHARACTER(LEN=*),INTENT(IN) :: filename
     570    INTEGER                     :: ierr
     571   
     572    IF (is_master) THEN
     573        ierr=NF90_OPEN(filename,NF90_WRITE,nid_restart)
     574        IF (ierr/=NF90_NOERR) THEN
     575          write(*,*)'open_restartphy: problem opening file '//trim(filename)
     576          write(*,*)trim(nf90_strerror(ierr))
     577          CALL ABORT
     578        ENDIF
    575579    ENDIF
    576580
  • trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90

    r3100 r3311  
    1414                       emisice, emissiv,             &
    1515                       iceradius, dtemisice, phisfi
    16   use iostart, only : open_restartphy, close_restartphy, &
     16  use iostart, only : create_restartphy, close_restartphy, &
    1717                      put_var, put_field, length
    1818  use mod_grid_phy_lmdz, only : klon_glo
     
    4646 
    4747  ! Create physics start file
    48   call open_restartphy(filename)
     48  call create_restartphy(filename)
    4949
    5050! tab_cntrl() contains run parameters
Note: See TracChangeset for help on using the changeset viewer.