New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
isfrst.F90 in NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfrst.F90 @ 11423

Last change on this file since 11423 was 11423, checked in by mathiot, 5 years ago

ENHANCE-02_ISF_nemo : add UKESM ice sheet coupling method (ticket #2142)

File size: 4.9 KB
Line 
1MODULE isfrst
2   !!======================================================================
3   !!                       ***  MODULE  isfrst  ***
4   !! iceshelf restart module :read/write iceshelf variables from/in restart
5   !!======================================================================
6   !! History :  4.1  !  2019-07  (P. Mathiot) Original code
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   isfrst : read/write iceshelf variables in/from restart
11   !!----------------------------------------------------------------------
12   USE oce            ! ocean dynamics and tracers
13   USE isf            ! ice shelf variable
14   !
15   USE in_out_manager ! I/O manager
16   USE iom            ! I/O library
17   !
18   IMPLICIT NONE
19
20   PRIVATE
21
22   PUBLIC isfrst_read, isfrst_write ! iceshelf restart read and write
23
24   !!----------------------------------------------------------------------
25   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
26   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
27   !! Software governed by the CeCILL license (see ./LICENSE)
28   !!----------------------------------------------------------------------
29CONTAINS
30   !
31   SUBROUTINE isfrst_read(cdisf, ptsc, pfwf, ptsc_b, pfwf_b )
32      !!---------------------------------------------------------------------
33      !!   isfrst_read : read iceshelf variables from restart
34      !!---------------------------------------------------------------------
35      !!-------------------------- OUT --------------------------------------
36      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(  out) :: pfwf_b
37      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(  out) :: ptsc_b
38      !!-------------------------- IN  --------------------------------------
39      CHARACTER(LEN=256)               , INTENT(in   ) :: cdisf
40      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: pfwf
41      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc
42      !!----------------------------------------------------------------------
43      CHARACTER(LEN=256) :: cfwf_b, chc_b, csc_b
44      !!----------------------------------------------------------------------
45      !
46      ! define variable name
47      cfwf_b = 'fwfisf_'//TRIM(cdisf)//'_b'
48      chc_b  = 'isf_hc_'//TRIM(cdisf)//'_b'
49      csc_b  = 'isf_sc_'//TRIM(cdisf)//'_b'
50      !
51      ! read restart
52      IF( iom_varid( numror, cfwf_b, ldstop = .FALSE. ) > 0 ) THEN
53         IF(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
54         CALL iom_get( numror, jpdom_autoglo, cfwf_b, pfwf_b(:,:)        , ldxios = lrxios )   ! before ice shelf melt
55         CALL iom_get( numror, jpdom_autoglo, chc_b , ptsc_b (:,:,jp_tem), ldxios = lrxios )   ! before ice shelf heat flux
56         CALL iom_get( numror, jpdom_autoglo, csc_b , ptsc_b (:,:,jp_sal), ldxios = lrxios )   ! before ice shelf heat flux
57      ELSE
58         pfwf_b(:,:)   = pfwf(:,:)
59         ptsc_b(:,:,:) = ptsc(:,:,:)
60      ENDIF
61      !
62      IF( lwxios ) THEN
63          CALL iom_set_rstw_var_active(TRIM(chc_b ))
64          CALL iom_set_rstw_var_active(TRIM(csc_b ))
65          CALL iom_set_rstw_var_active(TRIM(cfwf_b))
66      ENDIF
67
68   END SUBROUTINE isfrst_read
69   !
70   SUBROUTINE isfrst_write(kt, cdisf, ptsc, pfwf )
71      !!---------------------------------------------------------------------
72      !!   isfrst_write : write iceshelf variables in restart
73      !!---------------------------------------------------------------------
74      !!-------------------------- OUT --------------------------------------
75      !!-------------------------- IN  --------------------------------------
76      INTEGER                     , INTENT(in   ) :: kt
77      CHARACTER(LEN=256)          , INTENT(in   ) :: cdisf
78      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: pfwf
79      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc
80      !!---------------------------------------------------------------------
81      CHARACTER(LEN=256) :: cfwf_b, chc_b, csc_b
82      !!---------------------------------------------------------------------
83      !
84      ! ocean output print
85      IF(lwp) WRITE(numout,*)
86      IF(lwp) WRITE(numout,*) 'isf : isf fwf and heat fluxes written in ocean restart file ',   &
87         &                    'at it= ', kt,' date= ', ndastp
88      IF(lwp) WRITE(numout,*) '~~~~'
89      !
90      ! define variable name
91      cfwf_b = 'fwfisf_'//TRIM(cdisf)//'_b'
92      chc_b  = 'isf_hc_'//TRIM(cdisf)//'_b'
93      csc_b  = 'isf_sc_'//TRIM(cdisf)//'_b'
94      !
95      ! write restart variable
96      IF( lwxios ) CALL iom_swap( cwxios_context )
97      CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:)       , ldxios = lwxios )
98      CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem), ldxios = lwxios )
99      CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal), ldxios = lwxios )
100      IF( lwxios ) CALL iom_swap( cxios_context )
101      !
102   END SUBROUTINE isfrst_write
103   !
104END MODULE isfrst
Note: See TracBrowser for help on using the repository browser.