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

source: NEMO/trunk/src/OCE/ISF/isfrst.F90 @ 13970

Last change on this file since 13970 was 13970, checked in by andmirek, 3 years ago

Ticket #2462 into the trunk

File size: 4.3 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(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file'
55         CALL iom_get( numror, jpdom_auto, cfwf_b, pfwf_b(:,:)         )   ! before ice shelf melt
56         CALL iom_get( numror, jpdom_auto, chc_b , ptsc_b (:,:,jp_tem) )   ! before ice shelf heat flux
57         CALL iom_get( numror, jpdom_auto, csc_b , ptsc_b (:,:,jp_sal) )   ! before ice shelf heat flux
58      ELSE
59         pfwf_b(:,:)   = pfwf(:,:)
60         ptsc_b(:,:,:) = ptsc(:,:,:)
61      ENDIF
62      !
63   END SUBROUTINE isfrst_read
64   !
65   SUBROUTINE isfrst_write(kt, cdisf, ptsc, pfwf )
66      !!---------------------------------------------------------------------
67      !!
68      !!   isfrst_write : write iceshelf variables in restart
69      !!
70      !!-------------------------- IN  --------------------------------------
71      INTEGER                          , INTENT(in   ) :: kt
72      CHARACTER(LEN=3)                 , INTENT(in   ) :: cdisf
73      REAL(wp), DIMENSION(jpi,jpj)     , INTENT(in   ) :: pfwf
74      REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) :: ptsc
75      !!---------------------------------------------------------------------
76      CHARACTER(LEN=256) :: cfwf_b, chc_b, csc_b
77      !!---------------------------------------------------------------------
78      !
79      ! ocean output print
80      IF(lwp) WRITE(numout,*)
81      IF(lwp) WRITE(numout,*) 'isf : isf fwf and heat fluxes written in ocean restart file ',   &
82         &                    'at it= ', kt,' date= ', ndastp
83      IF(lwp) WRITE(numout,*) '~~~~'
84      !
85      ! define variable name
86      cfwf_b = 'fwfisf_'//TRIM(cdisf)//'_b'
87      chc_b  = 'isf_hc_'//TRIM(cdisf)//'_b'
88      csc_b  = 'isf_sc_'//TRIM(cdisf)//'_b'
89      !
90      ! write restart variable
91      CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:)        )
92      CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem) )
93      CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal) )
94      !
95   END SUBROUTINE isfrst_write
96   !
97END MODULE isfrst
Note: See TracBrowser for help on using the repository browser.