Back to home page

MITgcm

 
 

    


File indexing completed on 2025-08-05 05:09:14 UTC

view on githubraw file Latest commit 13ce79fe on 2025-08-04 21:05:34 UTC
367ecbf006 Gael*0001 #include "PROFILES_OPTIONS.h"
6e4c90fea3 Patr*0002 
13ce79fe94 Ivan*0003 C     ==================================================================
                0004 C
                0005 C     active_file.F: Routines to handle the I/O of the active file for
                0006 C                    the adjoint calculations. All files are direct
                0007 C                    access files.
                0008 C
                0009 C     Routines
                0010 C
                0011 C    o  active_read_profile       - Read  an active 1D record.
                0012 C    o  active_write_profile      - Write an active 1D record.
                0013 C
                0014 C
                0015 C        changed: gforget@ocean.mit.edu 23-Mar-2006
                0016 C
                0017 C     ==================================================================
                0018 
                0019 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0020 CBOP
                0021 C !ROUTINE: ACTIVE_READ_PROFILE
                0022 
                0023 C !INTERFACE:
                0024       SUBROUTINE ACTIVE_READ_PROFILE(
6e4c90fea3 Patr*0025      I                           active_num_file,
                0026      I                           nactive_var,
                0027      O                           active_var,
                0028      I                           active_varnum,
                0029      I                           irec,
                0030      I                           lAdInit,
                0031      I                           myOptimIter,
71a5587721 Gael*0032      I                           bi,
                0033      I                           bj,
13ce79fe94 Ivan*0034      I                           myThid,
6e4c90fea3 Patr*0035      I                           dummy
                0036      &                         )
                0037 
13ce79fe94 Ivan*0038 C     !DESCRIPTION:
                0039 C     Read an active 1D record from an profile data file.
6e4c90fea3 Patr*0040 
13ce79fe94 Ivan*0041 C     !USES:
                0042       IMPLICIT NONE
                0043 C     == Global variables ===
6e4c90fea3 Patr*0044 #include "EEPARAMS.h"
                0045 #include "SIZE.h"
                0046 #ifdef ALLOW_PROFILES
6328b73337 Gael*0047 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0048 # include "profiles.h"
                0049 #endif
                0050 
13ce79fe94 Ivan*0051 C     !INPUT/OUTPUT PARAMETERS:
                0052 C     active_var_file: filename
                0053 C     nactive_var:     integer size of active_var
                0054 C     active_var:      array
                0055 C     active_varname:  name for the quantity to save
                0056 C     irec:            record number
                0057 C     myOptimIter:     number of optimization iteration (default: 0)
                0058 C     myThid:          my thread ID number
                0059 C     lAdInit:         initialisation of corresponding adjoint
                0060 C                      variable and write to active file
                0061       INTEGER  nactive_var,active_num_file
                0062       _RL      active_var(nactive_var)
                0063       INTEGER  irec,active_varnum
                0064       INTEGER  myOptimIter
                0065       INTEGER  bi,bj,myThid
                0066       LOGICAL  lAdInit
6e4c90fea3 Patr*0067       _RL      dummy
13ce79fe94 Ivan*0068 CEOP
6e4c90fea3 Patr*0069 
                0070 #ifdef ALLOW_PROFILES
                0071 
13ce79fe94 Ivan*0072       CALL ACTIVE_READ_PROFILE_RL( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0073      &     active_num_file,
                0074      &     nactive_var, active_var, active_varnum, lAdInit,
71a5587721 Gael*0075      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
13ce79fe94 Ivan*0076      &     FORWARD_SIMULATION, myOptimIter,bi,bj, myThid)
6e4c90fea3 Patr*0077 
                0078 #endif
                0079 
13ce79fe94 Ivan*0080       RETURN
                0081       END
6e4c90fea3 Patr*0082 
13ce79fe94 Ivan*0083 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0084 CBOP
                0085 C !ROUTINE: ACTIVE_WRITE_PROFILE
6e4c90fea3 Patr*0086 
13ce79fe94 Ivan*0087 C !INTERFACE:
                0088       SUBROUTINE ACTIVE_WRITE_PROFILE(
6e4c90fea3 Patr*0089      I                           active_num_file,
                0090      I                           nactive_var,
                0091      I                           active_var,
                0092      I                           active_varnum,
                0093      I                           irec,
                0094      I                           myOptimIter,
71a5587721 Gael*0095      I                           bi,
                0096      I                           bj,
13ce79fe94 Ivan*0097      I                           myThid,
6e4c90fea3 Patr*0098      I                           dummy
                0099      &                         )
                0100 
13ce79fe94 Ivan*0101 C     !DESCRIPTION:
                0102 C     Write an active 1D record from file.
6e4c90fea3 Patr*0103 
                0104 C     !USES:
13ce79fe94 Ivan*0105       IMPLICIT NONE
                0106 C     == Global variables ===
6e4c90fea3 Patr*0107 #include "EEPARAMS.h"
                0108 #include "SIZE.h"
                0109 #ifdef ALLOW_PROFILES
6328b73337 Gael*0110 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0111 # include "profiles.h"
                0112 #endif
                0113 
13ce79fe94 Ivan*0114 C     !INPUT/OUTPUT PARAMETERS:
                0115 C     active_var_file: filename
                0116 C     nactive_var:     integer size of active_var
                0117 C     active_var:      array
                0118 C     active_varname:  name for the quantity to save
                0119 C     irec:            record number
                0120 C     myOptimIter:     number of optimization iteration (default: 0)
                0121 C     myThid:          my thread ID number
                0122       INTEGER  nactive_var,active_num_file, active_varnum
                0123       _RL      active_var(nactive_var)
                0124       INTEGER  irec
                0125       INTEGER  myOptimIter
                0126       INTEGER  bi,bj,myThid
6e4c90fea3 Patr*0127       _RL      dummy
13ce79fe94 Ivan*0128 CEOP
6e4c90fea3 Patr*0129 
                0130 #ifdef ALLOW_PROFILES
                0131 
13ce79fe94 Ivan*0132       CALL ACTIVE_WRITE_PROFILE_RL( fidforward(active_num_file,bi,bj),
6e4c90fea3 Patr*0133      &     active_num_file,
71a5587721 Gael*0134      &     nactive_var, active_var, active_varnum,
                0135      &     irec, prof_ind_glob(active_num_file,irec,bi,bj),
13ce79fe94 Ivan*0136      &     FORWARD_SIMULATION, myOptimIter,bi,bj, myThid)
6e4c90fea3 Patr*0137 
                0138 #endif
                0139 
13ce79fe94 Ivan*0140       RETURN
                0141       END