Back to home page

MITgcm

 
 

    


File indexing completed on 2025-11-07 06:08:37 UTC

view on githubraw file Latest commit b7411f1a on 2025-11-06 19:05:26 UTC
d8d1486ca1 Jean*0001 #include "KL10_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: KL10_OUTPUT
                0005 C     !INTERFACE:
                0006       SUBROUTINE KL10_OUTPUT( myTime, myIter, myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *==========================================================*
                0010 C     | SUBROUTINE KL10_OUTPUT
                0011 C     | o Do KL10 diagnostic output.
                0012 C     *==========================================================
                0013 C     | The following CPP flag (MULTIPLE_RECORD_KL10_STATE_FILES) is
                0014 C     | #define/#undefed here since it is specific to this routine
                0015 C     | and very user-preference specific.
                0016 C     |
                0017 C     | If #undefed (default) the state files are written as in all versions
                0018 C     | prior to checkpoint32, where a file is created per variable, per time
                0019 C     | and per tile. This *has* to be the default because most users use this
                0020 C     | mode and all utilities and scripts (diagnostic) assume this form.
                0021 C     | It is also robust, as explained below.
                0022 C     |
                0023 C     | If #defined, subsequent snap-shots are written as records in the
                0024 C     | same file (no iteration number in filenames).
                0025 C     | Advantages: - fewer files
                0026 C     |       - for small problems, is easy to copy the output around
                0027 C     | Disadvantages:
                0028 C     |       - breaks a lot of diagnostic scripts
                0029 C     |       - for large or long problems this creates huge files
                0030 C     |       - is an unexpected, unsolicited change in behaviour which came
                0031 C     |         as a surprise (in c32) and inconvenience to several users
                0032 C     |       - can not accomodate changing the frequency of output
                0033 C     |         after a pickup (this is trivial in previous method
                0034 C     |         but needs new code and parameters in this new method)
                0035 C     *==========================================================*
                0036 C     \ev
                0037 
                0038 C     !USES:
                0039       IMPLICIT NONE
                0040 C     === Global variables ===
                0041 #include "SIZE.h"
                0042 #include "EEPARAMS.h"
                0043 #include "PARAMS.h"
                0044 #include "KL10.h"
                0045 
                0046 C     !INPUT/OUTPUT PARAMETERS:
                0047 C     == Routine arguments ==
                0048 C     myTime :: my time in simulation ( s )
                0049 C     myIter :: my Iteration number
                0050 C     myThid :: my Thread Id number
                0051       _RL     myTime
                0052       INTEGER myIter
                0053       INTEGER myThid
                0054 
                0055 #ifdef ALLOW_KL10
                0056 
                0057 C     !FUNCTIONS:
                0058       LOGICAL  DIFFERENT_MULTIPLE
                0059       EXTERNAL DIFFERENT_MULTIPLE
                0060 
                0061 C     !LOCAL VARIABLES:
                0062 C     == Local variables ==
df5a9764ba Jean*0063       CHARACTER*(10) suff
d8d1486ca1 Jean*0064 CEOP
                0065 
                0066 C JMK TODO: average KLdiffAr as well as KLviscAr.  Though they are
                0067 C never different, but some folks may complain.
                0068 
                0069 C----------------------------------------------------------------
                0070 C     Dump snapshot of KL variables.
                0071 C----------------------------------------------------------------
                0072 
                0073       IF ( myIter.NE.nIter0 .AND.
                0074      &     DIFFERENT_MULTIPLE( KLdumpFreq, myTime, deltaTClock )
                0075      &   ) THEN
                0076 
                0077        IF (KLwriteState) THEN
                0078 C       Write each snap-shot as a new file
df5a9764ba Jean*0079         IF ( rwSuffixType.EQ.0 ) THEN
                0080           WRITE(suff,'(I10.10)') myIter
                0081         ELSE
                0082           CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
                0083         ENDIF
d8d1486ca1 Jean*0084         CALL WRITE_FLD_XYZ_RL('KLviscAr.',suff,KLviscAr,
                0085      &       myIter,myThid)
                0086         CALL WRITE_FLD_XYZ_RL('KLeps.',suff,KLeps,
                0087      &       myIter,myThid)
                0088        ENDIF
                0089 
                0090       ENDIF
                0091 
                0092 C----------------------------------------------------------------
b7411f1a84 Jean*0093 C     Do KL diagnostics
d8d1486ca1 Jean*0094 C----------------------------------------------------------------
                0095 
                0096 #ifdef ALLOW_DIAGNOSTICS
                0097       IF ( useDiagnostics .AND. myIter.NE.nIter0 ) THEN
                0098        CALL DIAGNOSTICS_FILL(KLviscAr,'KLviscAr',0,Nr,0,1,1,myThid)
                0099        CALL DIAGNOSTICS_FILL(KLdiffKr,'KLdiffKr',0,Nr,0,1,1,myThid)
                0100        CALL DIAGNOSTICS_FILL(KLeps,   'KLeps   ',0,Nr,0,1,1,myThid)
                0101       ENDIF
                0102 #endif /* ALLOW_DIAGNOSTICS */
                0103 
                0104 #endif /* ALLOW_KL10 */
                0105 
                0106       RETURN
                0107       END