/[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.8 - (hide annotations) (download)
Wed Oct 10 21:11:46 2012 UTC (12 years, 9 months ago) by dgoldberg
Branch: MAIN
Changes since 1.7: +7 -6 lines
reorg computations in timestep

1 dgoldberg 1.8 C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice/streamice_cost_surf_accum.F,v 1.5 2012/10/02 01:49:07 dgoldberg 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.8 suff = suff(1:ILNBLNK(suff))//'.bin'
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 dgoldberg 1.6 CADJ STORE H_streamice_prev = comlev1, key = ikey_dynamics,
72     CADJ & kind = isbyte
73 dgoldberg 1.7 CADJ STORE H_streamice = comlev1, key = ikey_dynamics,
74     CADJ & kind = isbyte
75 heimbach 1.4 #endif
76    
77 dgoldberg 1.1 C-- Calculate cost function on tile of this instance
78     do bj = jtlo,jthi
79     do bi = itlo,ithi
80     do j=1,sNy
81     do i=1,sNx
82    
83 dgoldberg 1.5
84     ! S_obs(i,j,bi,bj) = 0.0
85    
86 dgoldberg 1.1 cost_func1_streamice (bi,bj) =
87 heimbach 1.2 & cost_func1_streamice (bi,bj) +
88 dgoldberg 1.8 & streamice_wgt_surf * (S_obs(i,j,bi,bj)-
89     & surf_el_streamice(i,j,bi,bj))**2 / Nx / Ny +
90     & streamice_wgt_drift * (H_streamice(i,j,bi,bj)-
91     & H_streamice_prev(i,j,bi,bj))**2 / Nx / Ny
92    
93 dgoldberg 1.1
94     end do
95     end do
96     end do
97     end do
98    
99     #endif
100    
101     RETURN
102     END
103 heimbach 1.2

  ViewVC Help
Powered by ViewVC 1.1.22