My Project
ice_scaling.f90
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 !/===========================================================================/
13 ! CVS VERSION INFORMATION
14 ! $Id$
15 ! $Name$
16 ! $Revision$
17 !/===========================================================================/
18 
19 !=======================================================================
20 !BOP
21 !
22 ! !MODULE: ice_scaling
23 !
24 ! !DESCRIPTION:
25 !
26 ! Scale ice fluxes by ice area
27 !
28 ! !REVISION HISTORY:
29 !
30 ! author: C.M.Bitz ?
31 ! Modified: 16 Oct 03 For CICE-CSIM merge and vectorization
32 !
33 ! !INTERFACE:
34 !
35  module ice_scaling
36 !
37 ! !USES:
38 !
39  use ice_domain
40  use ice_kinds_mod
41  use ice_constants
42  use ice_state
43  use ice_flux
44  use ice_grid, only: tmask
45 !
46 !EOP
47 !
48  implicit none
49 
50 !=======================================================================
51 
52  contains
53 
54 !=======================================================================
55 !
56 !BOP
57 !
58 ! !IROUTINE: scale_fluxes
59 !
60 ! !DESCRIPTION:
61 !
62 ! Divide ice fluxes by ice area before sending them to the
63 ! coupler, since the coupler multiplies by ice area. This
64 ! is the ice area at the beginning of the timestep, i.e.
65 ! the value sent to the coupler.
66 !
67 ! !INTERFACE:
68 !
69  subroutine scale_fluxes
70 !
71 ! !REVISION HISTORY:
72 !
73 ! author: C.M.Bitz ?
74 !
75 ! !USES:
76 !
77  use ice_albedo
78 !
79 ! !INPUT/OUTPUT PARAMETERS:
80 !
81 !EOP
82 !
83  real (kind=dbl_kind) :: ar ! 1/aice
84 
85  integer (kind=int_kind) :: i, j
86 
87  do j=jlo,jhi
88  do i=ilo,ihi
89  if (tmask(i,j) .and. aice(i,j) > c0i) then
90  ar = c1i/aice(i,j)
91 ! strairxT(i,j) = strairxT(i,j) * ar
92 ! strairyT(i,j) = strairyT(i,j) * ar
93 ! the dynamic is not considered
94 
95  fsens(i,j) = fsens(i,j) * ar
96  flat(i,j) = flat(i,j) * ar
97  fswabs(i,j) = fswabs(i,j) * ar
98  flwout(i,j) = flwout(i,j) * ar
99  evap(i,j) = evap(i,j) * ar
100  tref(i,j) = tref(i,j) * ar
101  qref(i,j) = qref(i,j) * ar
102  fresh(i,j) = fresh(i,j) * ar
103  fsalt(i,j) = fsalt(i,j) * ar
104  fhnet(i,j) = fhnet(i,j) * ar
105  fswthru(i,j) = fswthru(i,j) * ar
106  else ! zero out fluxes
107  strairxt(i,j) = c0i
108  strairyt(i,j) = c0i
109 ! dynamic part using fvcom code
110  fsens(i,j) = c0i
111  flat(i,j) = c0i
112  fswabs(i,j) = c0i
113  flwout(i,j) = -stefan_boltzmann*(tffresh - tf(i,j))**4
114  ! to make upward longwave over ocean
115  ! reasonable for history file
116  evap(i,j) = c0i
117  tref(i,j) = tair(i,j)
118  qref(i,j) = qa(i,j)
119  fresh(i,j) = c0i
120  fsalt(i,j) = c0i
121  fhnet(i,j) = c0i
122  fswthru(i,j) = c0i
123  alvdf(i,j) = c0i ! zero out albedo where ice is absent
124  alidf(i,j) = c0i
125  alvdr(i,j) = c0i
126  alidr(i,j) = c0i
127  endif
128  enddo
129  enddo
130 
131  end subroutine scale_fluxes
132 
133 !=======================================================================
134 !
135 !BOP
136 !
137 ! !IROUTINE: scale_hist_fluxes - scale history fluxes
138 !
139 ! !INTERFACE:
140 !
141  subroutine scale_hist_fluxes
142 !
143 ! !DESCRIPTION:
144 !
145 ! Divide ice fluxes by ice area used by the coupler before writing out
146 ! diagnostics. aice\_init is the ice area saved from coupling. This
147 ! makes the fluxes written to the history file consistent with those
148 ! sent to the coupler.
149 !
150 ! !REVISION HISTORY:
151 !
152 ! author: C.M.Bitz ?
153 !
154 ! !USES:
155 !
156 ! !INPUT/OUTPUT PARAMETERS:
157 !
158 !EOP
159 !
160  real (kind=dbl_kind) :: ar ! 1/aice
161 
162  integer (kind=int_kind) :: i, j
163 
164  do j=jlo,jhi
165  do i=ilo,ihi
166  if (tmask(i,j) .and. aice_init(i,j) > c0i) then
167  ar = c1i/aice_init(i,j)
168  fresh_hist(i,j) = fresh_hist(i,j) * ar
169  fsalt_hist(i,j) = fsalt_hist(i,j) * ar
170  fhnet_hist(i,j) = fhnet_hist(i,j) * ar
171  fswthru_hist(i,j) = fswthru_hist(i,j) * ar
172  else
173  fresh_hist(i,j) = c0i
174  fsalt_hist(i,j) = c0i
175  fhnet_hist(i,j) = c0i
176  fswthru_hist(i,j) = c0i
177  endif
178  enddo
179  enddo
180 
181  end subroutine scale_hist_fluxes
182 
183 !=======================================================================
184 
185  end module ice_scaling
186 
187 !=======================================================================
real(kind=dbl_kind), dimension(:,:), allocatable, save strairyt
Definition: ice_flux.f90:55
real(kind=dbl_kind), dimension(:,:), allocatable, save tf
Definition: ice_flux.f90:91
real(kind=dbl_kind), dimension(:,:), allocatable, save fsalt_hist
Definition: ice_flux.f90:140
integer, parameter dbl_kind
subroutine scale_fluxes
Definition: ice_scaling.f90:70
real(kind=dbl_kind), dimension(:,:), allocatable, save alidf
Definition: ice_albedo.f90:83
integer(kind=int_kind) ihi
Definition: ice_domain.f90:101
real(kind=dbl_kind), parameter c0i
real(kind=dbl_kind), dimension(:,:), allocatable, save fhnet_hist
Definition: ice_flux.f90:140
real(kind=dbl_kind), dimension(:,:), allocatable, save flwout
Definition: ice_flux.f90:120
real(kind=dbl_kind), parameter stefan_boltzmann
real(kind=dbl_kind), dimension(:,:), allocatable, save fsens
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save fresh
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save alvdr
Definition: ice_albedo.f90:83
integer(kind=int_kind) jlo
Definition: ice_domain.f90:101
real(kind=dbl_kind), dimension(:,:), allocatable, save alvdf
Definition: ice_albedo.f90:83
integer(kind=int_kind) ilo
Definition: ice_domain.f90:101
real(kind=dbl_kind), parameter tffresh
integer(kind=int_kind) jhi
Definition: ice_domain.f90:101
real(kind=dbl_kind), dimension(:,:), allocatable, save qref
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save fswthru
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, target, save aice
Definition: ice_state.f90:82
real(kind=dbl_kind), dimension(:,:), allocatable, save fresh_hist
Definition: ice_flux.f90:140
real(kind=dbl_kind), dimension(:,:), allocatable, save fsalt
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save flat
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save fswabs
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save strairxt
Definition: ice_flux.f90:55
real(kind=dbl_kind), dimension(:,:), allocatable, save fswthru_hist
Definition: ice_flux.f90:140
real(kind=dbl_kind), dimension(:,:), allocatable, save alidr
Definition: ice_albedo.f90:83
real(kind=dbl_kind), dimension(:,:), allocatable, save evap
Definition: ice_flux.f90:120
real(kind=dbl_kind), parameter c1i
real(kind=dbl_kind), dimension(:,:), allocatable, save qa
Definition: ice_flux.f90:91
subroutine scale_hist_fluxes
real(kind=dbl_kind), dimension(:,:), allocatable, target, save aice_init
Definition: ice_state.f90:82
real(kind=dbl_kind), dimension(:,:), allocatable, save tref
Definition: ice_flux.f90:120
real(kind=dbl_kind), dimension(:,:), allocatable, save tair
Definition: ice_flux.f90:91
logical(kind=log_kind), dimension(:,:), allocatable tmask
Definition: ice_grid.f90:164
real(kind=dbl_kind), dimension(:,:), allocatable, save fhnet
Definition: ice_flux.f90:120