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

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

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


Revision 1.5 - (hide annotations) (download)
Tue Oct 2 01:49:07 2012 UTC (12 years, 9 months ago) by dgoldberg
Branch: MAIN
Changes since 1.4: +7 -3 lines
take out blanks from filename

1 dgoldberg 1.5 C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice/streamice_cost_surf_accum.F,v 1.4 2012/10/02 00:43:21 heimbach Exp $
2 dgoldberg 1.1 C $Name: $
3    
4     #include "COST_OPTIONS.h"
5     #include "STREAMICE_OPTIONS.h"
6    
7    
8     subroutine streamice_cost_surf_accum ( myThid, myIter )
9     C /==========================================================\
10     C | subroutine cost_test |
11     C | o this routine computes the cost function for the tiles |
12     C | of this processor |
13     C |==========================================================|
14     C | |
15     C | Notes |
16     C | ===== |
17     C \==========================================================/
18     IMPLICIT NONE
19    
20     C == Global variables ===
21     #include "SIZE.h"
22     #include "EEPARAMS.h"
23     #include "PARAMS.h"
24     #include "DYNVARS.h"
25     #include "GRID.h"
26     #ifdef ALLOW_STREAMICE
27     # include "STREAMICE.h"
28     #endif
29    
30     #include "cost.h"
31 heimbach 1.4 #ifdef ALLOW_AUTODIFF_TAMC
32     # include "tamc.h"
33     #endif
34 dgoldberg 1.1
35     C == Routine arguments ==
36     C myThid - Thread number for this instance of the routine.
37     integer myThid, myIter
38    
39    
40     #ifdef ALLOW_COST_TEST
41     C == Local variables
42     _RL thetaRef, HAF
43    
44     integer i, j, k, bi, bj
45     integer ig, jg
46     integer itlo,ithi
47     integer jtlo,jthi
48     INTEGER ILNBLNK
49     EXTERNAL ILNBLNK
50     CHARACTER*(MAX_LEN_FNAM) suff
51     CHARACTER*(MAX_LEN_FNAM) STREAMICEsurfOptimFile
52     _RL S_obs (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
53    
54     jtlo = mybylo(mythid)
55     jthi = mybyhi(mythid)
56     itlo = mybxlo(mythid)
57     ithi = mybxhi(mythid)
58 dgoldberg 1.5
59 dgoldberg 1.1 WRITE(suff,'(I10.10)') myIter
60 dgoldberg 1.5 suff = suff(1:ILNBLNK(suff))//'.data'
61 dgoldberg 1.1
62 dgoldberg 1.5 CALL READ_FLD_XY_RS( 'land_ice_surf.'//suff, ' ',
63 dgoldberg 1.1 & S_obs, 0, myThid )
64    
65     C-- Calculate mask for tracer cells (0 => land, 1 => water)
66     ! k=1
67    
68 heimbach 1.4 #ifdef ALLOW_AUTODIFF_TAMC
69     CADJ STORE surf_el_streamice = comlev1, key = ikey_dynamics,
70     CADJ & kind = isbyte
71     #endif
72    
73 dgoldberg 1.1 C-- Calculate cost function on tile of this instance
74     do bj = jtlo,jthi
75     do bi = itlo,ithi
76     do j=1,sNy
77     do i=1,sNx
78    
79 dgoldberg 1.5
80     ! S_obs(i,j,bi,bj) = 0.0
81    
82 dgoldberg 1.1 cost_func1_streamice (bi,bj) =
83 heimbach 1.2 & cost_func1_streamice (bi,bj) +
84     & 0.5 * (S_obs(i,j,bi,bj)-
85 heimbach 1.3 & surf_el_streamice(i,j,bi,bj))**2
86 dgoldberg 1.1
87     end do
88     end do
89     end do
90     end do
91    
92     #endif
93    
94     RETURN
95     END
96 heimbach 1.2

  ViewVC Help
Powered by ViewVC 1.1.22