Skip to content

Commit

Permalink
Fixed a conflict in .DoxygenLayout.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Shao committed Oct 7, 2016
2 parents e298f41 + 2ad74a0 commit fd3f1dd
Show file tree
Hide file tree
Showing 22 changed files with 1,988 additions and 1,682 deletions.
49 changes: 22 additions & 27 deletions .DoxygenLayout.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.6 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title="Main page" />
<tab type="pages" visible="yes" title="Pages" intro="" />
<tab type="modules" visible="yes" title="Modules" intro="" />
<tab type="namespaces" visible="no" title="Name Spaces">
<tab type="namespacelist" visible="yes" title="Name space list"
intro="" />
<tab type="namespacemembers" visible="yes" title="Name space members"
intro="" />
</tab>
<tab type="classes" visible="yes" title="F90 modules">
<tab type="classlist" visible="yes" title="F90 module list"
intro="This is the list of all F90 modules. Some are expandable which shows the defined types that are provided by that module." />
<!--tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/ -->
<tab type="hierarchy" visible="yes" title="Hierarchy" intro="" />
<tab type="classmembers" visible="yes" title="Module functions and variables"
intro="" />
</tab>
<tab type="files" visible="yes" title="Source files">
<tab type="filelist" visible="yes" title="File list" intro="" />
<tab type="globals" visible="yes" title="Globals" intro="" />
</tab>
<tab type="examples" visible="yes" title="Examples" intro="" />
</navindex>

<!-- Generated by doxygen 1.8.13 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title="Main page"/>
<tab type="pages" visible="yes" title="Pages" intro="Pages"/>
<tab type="modules" visible="yes" title="Modules" intro=""/>
<tab type="namespaces" visible="no" title="Name Spaces">
<tab type="namespacelist" visible="no" title="Name space list" intro=""/>
<tab type="namespacemembers" visible="no" title="Name space members" intro=""/>
</tab>
<tab type="classes" visible="yes" title="F90 modules">
<tab type="classlist" visible="yes" title="F90 module list" intro="This is the list of all F90 modules. Some are expandable which shows the defined types that are provided by that module."/>
<tab type="classindex" visible="no" title=""/>
<tab type="hierarchy" visible="yes" title="Hierarchy" intro=""/>
<tab type="classmembers" visible="yes" title="Module functions and variables" intro=""/>
</tab>
<tab type="files" visible="yes" title="Source files">
<tab type="filelist" visible="yes" title="File list" intro=""/>
<tab type="globals" visible="yes" title="Globals" intro=""/>
</tab>
<tab type="examples" visible="yes" title="Examples" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes" />
Expand Down
6 changes: 3 additions & 3 deletions .doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH =
EXAMPLE_PATH = config_src src

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
Expand All @@ -892,7 +892,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).

IMAGE_PATH =
IMAGE_PATH = .images config_src src

# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
Expand Down Expand Up @@ -2028,7 +2028,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH =
INCLUDE_PATH = src/framework

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
Binary file added .images/Arakawa_C_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/Grid_metrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/Horizontal_NE_indexing_nonsym.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .images/Horizontal_NE_indexing_sym.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions config_src/coupled_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ module MOM_surface_forcing
real, pointer, dimension(:,:) :: fprec =>NULL() ! mass flux of frozen precip (kg/m2/s)
real, pointer, dimension(:,:) :: runoff =>NULL() ! mass flux of liquid runoff (kg/m2/s)
real, pointer, dimension(:,:) :: calving =>NULL() ! mass flux of frozen runoff (kg/m2/s)
real, pointer, dimension(:,:) :: ustar_berg =>NULL() ! frictional velocity beneath icebergs (m/s)
real, pointer, dimension(:,:) :: area_berg =>NULL() ! area covered by icebergs(m2/m2)
real, pointer, dimension(:,:) :: mass_berg =>NULL() ! mass of icebergs(kg/m2)
real, pointer, dimension(:,:) :: runoff_hflx =>NULL() ! heat content of liquid runoff (W/m2)
real, pointer, dimension(:,:) :: calving_hflx =>NULL() ! heat content of frozen runoff (W/m2)
real, pointer, dimension(:,:) :: p =>NULL() ! pressure of overlying ice and atmosphere
Expand Down Expand Up @@ -469,6 +472,20 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, CS, state,
if (ASSOCIATED(IOB%calving)) &
fluxes%frunoff(i,j) = IOB%calving(i-i0,j-j0) * G%mask2dT(i,j)

if (((ASSOCIATED(IOB%ustar_berg) .and. (.not. ASSOCIATED(fluxes%ustar_berg))) &
.or. (ASSOCIATED(IOB%area_berg) .and. (.not. ASSOCIATED(fluxes%area_berg)))) &
.or. (ASSOCIATED(IOB%mass_berg) .and. (.not. ASSOCIATED(fluxes%mass_berg)))) &
call allocate_forcing_type(G, fluxes, iceberg=.true.)

if (ASSOCIATED(IOB%ustar_berg)) &
fluxes%ustar_berg(i,j) = IOB%ustar_berg(i-i0,j-j0) * G%mask2dT(i,j)

if (ASSOCIATED(IOB%area_berg)) &
fluxes%area_berg(i,j) = IOB%area_berg(i-i0,j-j0) * G%mask2dT(i,j)

if (ASSOCIATED(IOB%mass_berg)) &
fluxes%mass_berg(i,j) = IOB%mass_berg(i-i0,j-j0) * G%mask2dT(i,j)

if (ASSOCIATED(IOB%runoff_hflx)) &
fluxes%heat_content_lrunoff(i,j) = IOB%runoff_hflx(i-i0,j-j0) * G%mask2dT(i,j)

Expand Down Expand Up @@ -1197,6 +1214,12 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt)
write(outunit,100) 'iobt%runoff ', mpp_chksum( iobt%runoff )
write(outunit,100) 'iobt%calving ', mpp_chksum( iobt%calving )
write(outunit,100) 'iobt%p ', mpp_chksum( iobt%p )
if (ASSOCIATED(iobt%ustar_berg)) &
write(outunit,100) 'iobt%ustar_berg ', mpp_chksum( iobt%ustar_berg )
if (ASSOCIATED(iobt%area_berg)) &
write(outunit,100) 'iobt%area_berg ', mpp_chksum( iobt%area_berg )
if (ASSOCIATED(iobt%mass_berg)) &
write(outunit,100) 'iobt%mass_berg ', mpp_chksum( iobt%mass_berg )

100 FORMAT(" CHECKSUM::",A20," = ",Z20)
do n = 1, iobt%fluxes%num_bcs !{
Expand Down
95 changes: 90 additions & 5 deletions config_src/coupled_driver/ocean_model_MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ module ocean_model_mod
use mpp_domains_mod, only : domain2d, mpp_get_layout, mpp_get_global_domain
use mpp_domains_mod, only : mpp_define_domains, mpp_get_compute_domain, mpp_get_data_domain
use atmos_ocean_fluxes_mod, only : aof_set_coupler_flux
use MOM_forcing_type, only : allocate_forcing_type
use fms_mod, only : stdout
use mpp_mod, only : mpp_chksum
use MOM_domains, only : pass_var, pass_vector, TO_ALL, CGRID_NE, BGRID_NE

#include <MOM_memory.h>

Expand Down Expand Up @@ -153,14 +155,17 @@ module ocean_model_mod

integer :: nstep = 0 ! The number of calls to update_ocean.
logical :: use_ice_shelf ! If true, the ice shelf model is enabled.
logical :: icebergs_apply_rigid_boundary ! If true, the icebergs can change ocean bd condition.
real :: kv_iceberg ! The viscosity of the icebergs in m2/s (for ice rigidity)
real :: density_iceberg ! A typical density of icebergs in kg/m3 (for ice rigidity)
type(ice_shelf_CS), pointer :: Ice_shelf_CSp => NULL()
logical :: restore_salinity ! If true, the coupled MOM driver adds a term to
! restore salinity to a specified value.
logical :: restore_temp ! If true, the coupled MOM driver adds a term to
! restore sst to a specified value.
real :: press_to_z ! A conversion factor between pressure and ocean
! depth in m, usually 1/(rho_0*g), in m Pa-1.
real :: C_p ! The heat capacity of seawater, in J K-1 kg-1.
real :: C_p ! The heat capacity of seawater, in J K-1 kg-1.

type(directories) :: dirs ! A structure containing several relevant directory paths.
type(forcing) :: fluxes ! A structure containing pointers to
Expand Down Expand Up @@ -280,6 +285,16 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in)
call get_param(param_file, mod, "ICE_SHELF", OS%use_ice_shelf, &
"If true, enables the ice shelf model.", default=.false.)

call get_param(param_file, mod, "ICEBERGS_APPLY_RIGID_BOUNDARY", OS%icebergs_apply_rigid_boundary, &
"If true, allows icebergs to change boundary condition felt by ocean", default=.false.)

if (OS%icebergs_apply_rigid_boundary) then
call get_param(param_file, mod, "KV_ICEBERG", OS%kv_iceberg, &
"The viscosity of the icebergs", units="m2 s-1",default=1.0e10)
call get_param(param_file, mod, "DENSITY_ICEBERGS", OS%density_iceberg, &
"A typical density of icebergs.", units="kg m-3", default=917.0)
endif

OS%press_to_z = 1.0/(Rho0*G_Earth)

call surface_forcing_init(Time_in, OS%grid, param_file, OS%MOM_CSp%diag, &
Expand All @@ -289,6 +304,11 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in)
call initialize_ice_shelf(param_file, OS%grid, OS%Time, OS%ice_shelf_CSp, &
OS%MOM_CSp%diag, OS%fluxes)
endif
if (OS%icebergs_apply_rigid_boundary) then
!call allocate_forcing_type(OS%grid, OS%fluxes, iceberg=.true.)
!This assumes that the iceshelf and ocean are on the same grid. I hope this is true
if (.not. OS%use_ice_shelf) call allocate_forcing_type(OS%grid, OS%fluxes, ustar=.true., shelf=.true.)
endif

call MOM_sum_output_init(OS%grid, param_file, OS%dirs%output_directory, &
OS%MOM_CSp%ntrunc, Time_init, OS%sum_output_CSp)
Expand Down Expand Up @@ -394,23 +414,28 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
call MOM_generic_tracer_fluxes_accumulate(OS%fluxes, weight) !here weight=1, just saving the current fluxes
#endif

! Add ice shelf fluxes

! Add ice shelf fluxes
if (OS%use_ice_shelf) then
call shelf_calc_flux(OS%State, OS%fluxes, OS%Time, time_step, OS%Ice_shelf_CSp)
endif

if (OS%icebergs_apply_rigid_boundary) then
!This assumes that the iceshelf and ocean are on the same grid. I hope this is true
call add_berg_flux_to_shelf(OS%grid, OS%fluxes,OS%use_ice_shelf,OS%density_iceberg,OS%kv_iceberg)
endif
! Indicate that there are new unused fluxes.
OS%fluxes%fluxes_used = .false.
OS%fluxes%dt_buoy_accum = time_step
else
OS%flux_tmp%C_p = OS%fluxes%C_p
call convert_IOB_to_fluxes(Ice_ocean_boundary, OS%flux_tmp, index_bnds, OS%Time, &
OS%grid, OS%forcing_CSp, OS%state, OS%restore_salinity,OS%restore_temp)

if (OS%use_ice_shelf) then
call shelf_calc_flux(OS%State, OS%flux_tmp, OS%Time, time_step, OS%Ice_shelf_CSp)
endif
if (OS%icebergs_apply_rigid_boundary) then
!This assumes that the iceshelf and ocean are on the same grid. I hope this is true
call add_berg_flux_to_shelf(OS%grid, OS%flux_tmp, OS%use_ice_shelf,OS%density_iceberg,OS%kv_iceberg)
endif

call forcing_accumulate(OS%flux_tmp, OS%fluxes, time_step, OS%grid, weight)
#ifdef _USE_GENERIC_TRACER
Expand Down Expand Up @@ -477,6 +502,66 @@ end subroutine update_ocean_model
! the any restart file name as a prefix.
! </DESCRIPTION>
!

subroutine add_berg_flux_to_shelf(G, fluxes, use_ice_shelf, density_ice, kv_ice)
type(ocean_grid_type), intent(inout) :: G
type(forcing), intent(inout) :: fluxes
logical, intent(in) :: use_ice_shelf
real, intent(in) :: kv_ice ! The viscosity of ice, in m2 s-1.
real, intent(in) :: density_ice ! A typical density of ice, in kg m-3.
! Arguments:
! (in) fluxes - A structure of surface fluxes that may be used.
! (in) G - The ocean's grid structure.
integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
isd = G%isd ; jsd = G%jsd ; ied = G%ied ; jed = G%jed
!This routine adds iceberg data to the ice shelf data (if ice shelf is used)
!which can then be used to change the top of ocean boundary condition used in
!the ocean model. This routine is taken from the add_shelf_flux subroutine
!within the ice shelf model.

if (.not. (((associated(fluxes%frac_shelf_h) .and. associated(fluxes%frac_shelf_u)) &
.and.(associated(fluxes%frac_shelf_v) .and. associated(fluxes%ustar_shelf)))&
.and.(associated(fluxes%rigidity_ice_u) .and. associated(fluxes%rigidity_ice_v)))) return

if (.not. ((associated(fluxes%area_berg) .and. associated(fluxes%ustar_berg)) .and. associated(fluxes%mass_berg) ) ) return

if (.not. use_ice_shelf) then
fluxes%frac_shelf_h(:,:)=0.
fluxes%frac_shelf_u(:,:)=0.
fluxes%frac_shelf_v(:,:)=0.
fluxes%ustar_shelf(:,:)=0.
fluxes%rigidity_ice_u(:,:)=0.
fluxes%rigidity_ice_v(:,:)=0.
endif

do j=jsd,jed ; do i=isd,ied
if (G%areaT(i,j) > 0.0) &
fluxes%frac_shelf_h(i,j) = fluxes%frac_shelf_h(i,j) + fluxes%area_berg(i,j)
fluxes%ustar_shelf(i,j) = fluxes%ustar_shelf(i,j) + fluxes%ustar_berg(i,j)
enddo ; enddo
!do I=isd,ied-1 ; do j=isd,jed
do j=jsd,jed ; do i=isd,ied-1 ! ### changed stride order; i->ied-1?
fluxes%frac_shelf_u(I,j) = 0.0
if ((G%areaT(i,j) + G%areaT(i+1,j) > 0.0)) & ! .and. (G%dxdy_u(I,j) > 0.0)) &
fluxes%frac_shelf_u(I,j) = fluxes%frac_shelf_u(I,j) + (((fluxes%area_berg(i,j)*G%areaT(i,j)) + (fluxes%area_berg(i+1,j)*G%areaT(i+1,j))) / &
(G%areaT(i,j) + G%areaT(i+1,j)))
fluxes%rigidity_ice_u(I,j) = fluxes%rigidity_ice_u(I,j) +((kv_ice / density_ice) * &
min(fluxes%mass_berg(i,j), fluxes%mass_berg(i+1,j)))
enddo ; enddo
do j=jsd,jed-1 ; do i=isd,ied ! ### change stride order; j->jed-1?
!do i=isd,ied ; do J=isd,jed-1
fluxes%frac_shelf_v(i,J) = 0.0
if ((G%areaT(i,j) + G%areaT(i,j+1) > 0.0)) & ! .and. (G%dxdy_v(i,J) > 0.0)) &
fluxes%frac_shelf_v(i,J) = fluxes%frac_shelf_v(i,J) + (((fluxes%area_berg(i,j)*G%areaT(i,j)) + (fluxes%area_berg(i,j+1)*G%areaT(i,j+1))) / &
(G%areaT(i,j) + G%areaT(i,j+1) ))
fluxes%rigidity_ice_v(i,J) = fluxes%rigidity_ice_v(i,J) +((kv_ice / density_ice) * &
max(fluxes%mass_berg(i,j), fluxes%mass_berg(i,j+1)))
enddo ; enddo
call pass_vector(fluxes%frac_shelf_u, fluxes%frac_shelf_v, G%domain, TO_ALL, CGRID_NE)

end subroutine add_berg_flux_to_shelf

subroutine ocean_model_restart(OS, timestamp)
type(ocean_state_type), pointer :: OS
character(len=*), intent(in), optional :: timestamp
Expand Down
2 changes: 1 addition & 1 deletion src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2870,7 +2870,7 @@ end subroutine regridding_memory_deallocation
!! Most calculations in this module start with the coordinate at the bottom
!! of the column set to -depth, and use a increasing value of coordinate with
!! decreasing k. This is consistent with the rest of MOM6 that uses position,
!! f$z\f$ which is a negative quantity for most of the ocean.
!! \f$z\f$ which is a negative quantity for most of the ocean.
!!
!! A change in grid is define through a change in position of the interfaces:
!! \f[
Expand Down
9 changes: 5 additions & 4 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,9 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call create_group_pass(CS%pass_tau_ustar_psurf, fluxes%ustar(:,:), G%Domain)
if (ASSOCIATED(fluxes%p_surf)) &
call create_group_pass(CS%pass_tau_ustar_psurf, fluxes%p_surf(:,:), G%Domain)
if (CS%thickness_diffuse .OR. CS%mixedlayer_restrat) &
if ((CS%thickness_diffuse .and. (.not.CS%thickness_diffuse_first .or. CS%dt_trans == 0) ) .OR. CS%mixedlayer_restrat) &
call create_group_pass(CS%pass_h, h, G%Domain)

if (CS%diabatic_first) then
if (associated(CS%visc%Ray_u) .and. associated(CS%visc%Ray_v)) &
call create_group_pass(CS%pass_ray, CS%visc%Ray_u, CS%visc%Ray_v, G%Domain, &
Expand Down Expand Up @@ -4079,9 +4080,9 @@ end subroutine MOM_end
!! * FRAZIL_HEAT_TENDENCY generally has 3d structure, since MOM6 frazil calculation checks the
!! full ocean column.
!!
!! * FRAZIL_HEAT_TENDENCY[k=@sum] = HFSIFRAZIL = column integrated frazil heating.
!! * FRAZIL_HEAT_TENDENCY[k=\@sum] = HFSIFRAZIL = column integrated frazil heating.
!!
!! * HFDS = FRAZIL_HEAT_TENDENCY[k=@sum] + BOUNDARY_FORCING_HEAT_TENDENCY[k=@sum]
!! * HFDS = FRAZIL_HEAT_TENDENCY[k=\@sum] + BOUNDARY_FORCING_HEAT_TENDENCY[k=\@sum]
!!
!! Here is an example 2d heat budget (depth summed) diagnostic for MOM.
!!
Expand All @@ -4107,7 +4108,7 @@ end subroutine MOM_end
!! * BOUNDARY_FORCING_SALT_TENDENCY generally has 3d structure, with k > 1 contributions from
!! the case when layers are tiny, in which case MOM6 partitions tendencies into k > 1 layers.
!!
!! * SFDSI = BOUNDARY_FORCING_SALT_TENDENCY[k=@sum]
!! * SFDSI = BOUNDARY_FORCING_SALT_TENDENCY[k=\@sum]
!!
!! Here is an example 2d salt budget (depth summed) diagnostic for MOM.
!!
Expand Down
Loading

0 comments on commit fd3f1dd

Please sign in to comment.