/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/streamice_dump_ad.F
ViewVC logotype

Annotation of /MITgcm_contrib/dgoldberg/streamice/streamice_dump_ad.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Tue Sep 4 21:11:44 2012 UTC (12 years, 10 months ago) by dgoldberg
Branch: MAIN
Changes since 1.1: +14 -4 lines
recent changes.. DNG

1 dgoldberg 1.2 C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice/streamice_dump_ad.F,v 1.1 2012/07/27 21:07:13 heimbach Exp $
2 heimbach 1.1 C $Name: $
3    
4     #include "AD_CONFIG.h"
5     #include "PACKAGES_CONFIG.h"
6     #include "STREAMICE_OPTIONS.h"
7    
8     CBOP
9     C !ROUTINE: adstreamice_dump
10     C !INTERFACE:
11     subroutine adstreamice_dump( mytime, myiter, myThid )
12    
13     C !DESCRIPTION: \bv
14     C *==========================================================*
15     C | SUBROUTINE adstreamice_dump |
16     C *==========================================================*
17     C Extract adjoint variable from TAMC/TAF-generated
18     C adjoint common blocks, contained in adcommon.h
19     C and write fields to file;
20     C Make sure common blocks in adcommon.h are up-to-date
21     C w.r.t. current adjoint code.
22     C *==========================================================*
23     C \ev
24    
25     C !USES:
26     IMPLICIT NONE
27    
28     C == Global variables ===
29     #include "SIZE.h"
30     #include "EEPARAMS.h"
31     #include "PARAMS.h"
32     #include "STREAMICE.h"
33     #include "GRID.h"
34     #ifdef ALLOW_AUTODIFF_MONITOR
35     # include "adcommon.h"
36     #endif
37    
38     LOGICAL DIFFERENT_MULTIPLE
39     EXTERNAL DIFFERENT_MULTIPLE
40     INTEGER IO_ERRCOUNT
41     EXTERNAL IO_ERRCOUNT
42    
43     C !INPUT/OUTPUT PARAMETERS:
44     C == Routine arguments ==
45     C myIter - iteration counter for this thread
46     C myTime - time counter for this thread
47     C myThid - Thread number for this instance of the routine.
48     integer myThid
49     integer myiter
50     _RL mytime
51    
52     #if (defined (ALLOW_ADJOINT_RUN) || defined (ALLOW_ADMTLM))
53    
54     C !LOCAL VARIABLES:
55     c == local variables ==
56     C suff - Hold suffix part of a filename
57     C beginIOErrCount - Begin and end IO error counts
58     C endIOErrCount
59     C msgBuf - Error message buffer
60     CHARACTER*(MAX_LEN_FNAM) suff
61     INTEGER beginIOErrCount
62     INTEGER endIOErrCount
63     CHARACTER*(MAX_LEN_MBUF) msgBuf
64    
65 dgoldberg 1.2 double precision ada_glen(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
66 heimbach 1.1 double precision adarea_shelf_streamice(1-olx:snx+olx,1-oly:sny+
67     $oly,nsx,nsy)
68 dgoldberg 1.2 double precision adbdot_streamice(1-olx:snx+olx,1-oly:sny+oly,nsx,
69     $nsy)
70 heimbach 1.1 double precision adc_basal_friction(1-olx:snx+olx,1-oly:sny+oly,
71     $nsx,nsy)
72     double precision adh_streamice(1-olx:snx+olx,1-oly:sny+oly,nsx,
73     $nsy)
74     double precision adsurf_el_streamice(1-olx:snx+olx,1-oly:sny+oly,
75     $nsx,nsy)
76     double precision adtau_beta_eff_streamice(1-olx:snx+olx,1-oly:sny+
77     $oly,nsx,nsy)
78     double precision adu_streamice(1-olx:snx+olx,1-oly:sny+oly,nsx,
79     $nsy)
80     double precision adv_streamice(1-olx:snx+olx,1-oly:sny+oly,nsx,
81     $nsy)
82     double precision advisc_streamice(1-olx:snx+olx,1-oly:sny+oly,nsx,
83     $nsy)
84 dgoldberg 1.2 common /adstreamice_fields_rl/ adh_streamice, adu_streamice,
85     $adv_streamice, advisc_streamice, adtau_beta_eff_streamice,
86     $adsurf_el_streamice, adarea_shelf_streamice, adc_basal_friction,
87     $ada_glen, adbdot_streamice
88 heimbach 1.1 c
89     double precision adr_low(1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
90     common /adgrid_rs/ adr_low
91    
92     c == end of interface ==
93     CEOP
94    
95     IF (
96     & DIFFERENT_MULTIPLE(streamice_adjDump,mytime,deltaTClock)
97     & ) THEN
98    
99     C-- Set suffix for this set of data files.
100     WRITE(suff,'(I10.10)') myIter
101     writeBinaryPrec = writeStatePrec
102    
103     C-- Read IO error counter
104     beginIOErrCount = IO_ERRCOUNT(myThid)
105    
106     CALL WRITE_REC_3D_RL(
107     & 'ADJc_basal_friction.'//suff, writeBinaryPrec,
108     & 1, adc_basal_friction, 1, myIter, myThid )
109     CALL WRITE_REC_3D_RL(
110     & 'ADJh_streamice.'//suff, writeBinaryPrec,
111     & 1, adh_streamice, 1, myIter, myThid )
112     CALL WRITE_REC_3D_RL(
113     & 'ADJr_low.'//suff, writeBinaryPrec,
114     & 1, adr_low, 1, myIter, myThid )
115 dgoldberg 1.2 CALL WRITE_REC_3D_RL(
116     & 'ADJa_glen.'//suff, writeBinaryPrec,
117     & 1, ada_glen, 1, myIter, myThid )
118     CALL WRITE_REC_3D_RL(
119     & 'ADJbdot.'//suff, writeBinaryPrec,
120     & 1, adbdot_streamice, 1, myIter, myThid )
121 heimbach 1.1
122     ENDIF
123    
124     #endif /* ALLOW_ADJOINT_RUN */
125    
126     RETURN
127     END

  ViewVC Help
Powered by ViewVC 1.1.22