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/2020/dev_12905_xios_ancil/src/OCE/ISF – NEMO

source: NEMO/branches/2020/dev_12905_xios_ancil/src/OCE/ISF/isfrst.F90 @ 13016

Last change on this file since 13016 was 13016, checked in by andmirek, 4 years ago

Ticket #2475 implementation of new interface

File size: 4.8 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   !
13   USE par_oce, ONLY: jpi,jpj,jpk,jpts ! time and space domain
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      !!
34      !!   isfrst_read : read iceshelf variables from restart
35      !!
36      !!-------------------------- OUT --------------------------------------
37      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(  out) :: pfwf_b
38      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(  out) :: ptsc_b
39      !!-------------------------- IN  --------------------------------------
40      CHARACTER(LEN=3)                 , INTENT(in   ) :: cdisf
41      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: pfwf
42      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc
43      !!----------------------------------------------------------------------
44      CHARACTER(LEN=256) :: cfwf_b, chc_b, csc_b
45      !!----------------------------------------------------------------------
46      !
47      ! define variable name
48      cfwf_b = 'fwfisf_'//TRIM(cdisf)//'_b'
49      chc_b  = 'isf_hc_'//TRIM(cdisf)//'_b'
50      csc_b  = 'isf_sc_'//TRIM(cdisf)//'_b'
51      !
52      ! read restart
53      IF( iom_varid( numror, cfwf_b, ldstop = .FALSE. ) > 0 ) THEN
54         IF(lrxios) CALL iom_swap( TRIM(crxios_context) )
55         IF(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
56         CALL iom_get( numror, jpdom_autoglo, cfwf_b, pfwf_b(:,:)        , ldxios = lrxios )   ! before ice shelf melt
57         CALL iom_get( numror, jpdom_autoglo, chc_b , ptsc_b (:,:,jp_tem), ldxios = lrxios )   ! before ice shelf heat flux
58         CALL iom_get( numror, jpdom_autoglo, csc_b , ptsc_b (:,:,jp_sal), ldxios = lrxios )   ! before ice shelf heat flux
59         IF(lrxios) CALL iom_swap( TRIM(cxios_context) )
60      ELSE
61         pfwf_b(:,:)   = pfwf(:,:)
62         ptsc_b(:,:,:) = ptsc(:,:,:)
63      ENDIF
64      !
65      IF( lwxios ) THEN
66         CALL iom_set_rstw_var_active(TRIM(chc_b ))
67         CALL iom_set_rstw_var_active(TRIM(csc_b ))
68         CALL iom_set_rstw_var_active(TRIM(cfwf_b))
69      ENDIF
70
71   END SUBROUTINE isfrst_read
72   !
73   SUBROUTINE isfrst_write(kt, cdisf, ptsc, pfwf )
74      !!---------------------------------------------------------------------
75      !!
76      !!   isfrst_write : write iceshelf variables in restart
77      !!
78      !!-------------------------- IN  --------------------------------------
79      INTEGER                          , INTENT(in   ) :: kt
80      CHARACTER(LEN=3)                 , INTENT(in   ) :: cdisf
81      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: pfwf
82      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc
83      !!---------------------------------------------------------------------
84      CHARACTER(LEN=256) :: cfwf_b, chc_b, csc_b
85      !!---------------------------------------------------------------------
86      !
87      ! ocean output print
88      IF(lwp) WRITE(numout,*)
89      IF(lwp) WRITE(numout,*) 'isf : isf fwf and heat fluxes written in ocean restart file ',   &
90         &                    'at it= ', kt,' date= ', ndastp
91      IF(lwp) WRITE(numout,*) '~~~~'
92      !
93      ! define variable name
94      cfwf_b = 'fwfisf_'//TRIM(cdisf)//'_b'
95      chc_b  = 'isf_hc_'//TRIM(cdisf)//'_b'
96      csc_b  = 'isf_sc_'//TRIM(cdisf)//'_b'
97      !
98      ! write restart variable
99      IF( lwxios ) CALL iom_swap( cwxios_context )
100      CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:)       , ldxios = lwxios )
101      CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem), ldxios = lwxios )
102      CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal), ldxios = lwxios )
103      IF( lwxios ) CALL iom_swap( cxios_context )
104      !
105   END SUBROUTINE isfrst_write
106   !
107END MODULE isfrst
Note: See TracBrowser for help on using the repository browser.