Skip to content

Commit

Permalink
Merge branch 'docs_test2' into docs_test
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Feb 15, 2017
2 parents 9e27c2b + 138be1c commit 4f912fd
Show file tree
Hide file tree
Showing 61 changed files with 3,260 additions and 1,622 deletions.
4 changes: 4 additions & 0 deletions .DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<tab type="globals" visible="yes" title="Globals" intro=""/>
</tab>
<tab type="examples" visible="yes" title="Examples" intro=""/>
<tab type="usergroup" title="Wikis and Related Pages">
<tab type="user" title="Getting Started" url="https://github.com/NOAA-GFDL/MOM6-examples/wiki"/>
<tab type="user" title="Developer's wiki" url="https://github.com/NOAA-GFDL/MOM6/wiki"/>
</tab>
</navindex>

<!-- Layout definition for a class page -->
Expand Down
41 changes: 31 additions & 10 deletions .doxygen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Doxyfile 1.8.12
# Doxyfile 1.8.14

# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
Expand Down Expand Up @@ -777,10 +777,12 @@ WARN_LOGFILE = doxygen.log
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces.
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = config_src src README.md
INPUT = config_src \
src \
README.md

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand All @@ -802,8 +804,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf and *.qsf.
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.

FILE_PATTERNS = *.c \
*.cc \
Expand Down Expand Up @@ -872,7 +874,8 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = config_src src
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 +895,9 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).

IMAGE_PATH = .images config_src src
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 @@ -994,7 +999,7 @@ REFERENCES_RELATION = YES
# link to the documentation.
# The default value is: YES.

REFERENCES_LINK_SOURCE = YES
REFERENCES_LINK_SOURCE = NO

# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
# source code will show a tooltip with additional information such as prototype,
Expand Down Expand Up @@ -1184,12 +1189,23 @@ HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to YES can help to show when doxygen was last run and thus if the
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# documentation is up to date.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_TIMESTAMP = NO

# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_DYNAMIC_MENUS = YES

# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
Expand Down Expand Up @@ -2368,6 +2384,11 @@ DIAFILE_DIRS =

PLANTUML_JAR_PATH =

# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml.

PLANTUML_CFG_FILE =

# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.

Expand Down
24 changes: 23 additions & 1 deletion config_src/solo_driver/MOM_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ program MOM_main
#include "version_variable.h"
character(len=40) :: mod = "MOM_main (MOM_driver)" ! This module's name.

namelist /ocean_solo_nml/ date_init, calendar, months, days, hours, minutes, seconds
integer :: ocean_nthreads = 1
integer :: ncores_per_node = 36
logical :: use_hyper_thread = .false.
integer :: omp_get_num_threads,omp_get_thread_num,get_cpu_affinity,adder,base_cpu
namelist /ocean_solo_nml/ date_init, calendar, months, days, hours, minutes, seconds,&
ocean_nthreads, ncores_per_node, use_hyper_thread

!#######################################################################

Expand Down Expand Up @@ -232,6 +237,23 @@ program MOM_main
endif
endif

!$ call omp_set_num_threads(ocean_nthreads)
!$OMP PARALLEL private(adder)
!$ base_cpu = get_cpu_affinity()
!$ if (use_hyper_thread) then
!$ if (imod(omp_get_thread_num(),2) == 0) then
!$ adder = omp_get_thread_num()/2
!$ else
!$ adder = ncores_per_node + omp_get_thread_num()/2
!$ endif
!$ else
!$ adder = omp_get_thread_num()
!$ endif
!$ call set_cpu_affinity (base_cpu + adder)
!$ write(6,*) " ocean ", omp_get_num_threads(), get_cpu_affinity(), adder, omp_get_thread_num()
!$ call flush(6)
!$OMP END PARALLEL

! Read ocean_solo restart, which can override settings from the namelist.
if (file_exists(trim(dirs%restart_input_dir)//'ocean_solo.res')) then
call open_file(unit,trim(dirs%restart_input_dir)//'ocean_solo.res', &
Expand Down
8 changes: 4 additions & 4 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ subroutine remap_all_state_vars(CS_remapping, CS_ALE, G, GV, h_old, h_new, dxInt

! Remap tracer
!$OMP parallel default(none) shared(G,GV,h_old,h_new,dxInterface,CS_remapping,nz,Reg,u,v,ntr,show_call_tree, &
!$OMP dt,h2,CS_ALE,work_conc,work_cont,work_2d,Idt,ppt2mks) &
!$OMP private(h1,dx,u_column)
!$OMP dt,CS_ALE,work_conc,work_cont,work_2d,Idt,ppt2mks) &
!$OMP private(h1,h2,dx,u_column)
if (ntr>0) then
if (show_call_tree) call callTree_waypoint("remapping tracers (remap_all_state_vars)")
!$OMP do
Expand Down Expand Up @@ -832,8 +832,8 @@ subroutine ALE_remap_scalar(CS, G, GV, nk_src, h_src, s_src, h_dst, s_dst, all_c
n_points = nk_src

!$OMP parallel default(none) shared(CS,G,GV,h_src,s_src,h_dst,s_dst &
!$OMP ,ignore_vanished_layers, use_remapping_core_w, nk_src,dx ) &
!$OMP firstprivate(n_points)
!$OMP ,ignore_vanished_layers, use_remapping_core_w, nk_src ) &
!$OMP firstprivate(n_points,dx)
!$OMP do
do j = G%jsc,G%jec
do i = G%isc,G%iec
Expand Down
13 changes: 9 additions & 4 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,13 @@ subroutine initialize_regridding(CS, GV, max_depth, param_file, mod, coord_mode,
'Unable to interpret "'//trim(string)//'".')
endif
allocate(dz(ke))
dz(:) = uniformResolution(ke, coord_mode, tmpReal, &
if (ke==1) then
dz(:) = uniformResolution(ke, coord_mode, tmpReal, GV%Rlay(1), GV%Rlay(1))
else
dz(:) = uniformResolution(ke, coord_mode, tmpReal, &
GV%Rlay(1)+0.5*(GV%Rlay(1)-GV%Rlay(2)), &
GV%Rlay(ke)+0.5*(GV%Rlay(ke)-GV%Rlay(ke-1)) )
endif
if (main_parameters) call log_param(param_file, mod, "!"//coord_res_param, dz, &
trim(message), units=trim(coord_units))
elseif (trim(string)=='PARAM') then
Expand Down Expand Up @@ -1125,9 +1129,10 @@ subroutine build_zstar_grid( CS, G, GV, h, dzInterface, frac_shelf_h)
if (associated(frac_shelf_h)) ice_shelf = .true.
endif

!$OMP parallel do default(none) shared(G,GV,dzInterface,CS,nz,h,frac_shelf_h) &
!$OMP private(nominalDepth,totalThickness,minThickness, &
!$OMP zNew,dh,zOld,ice_shelf)
!$OMP parallel do default(none) shared(G,GV,dzInterface,CS,nz,h,frac_shelf_h, &
!$OMP ice_shelf,minThickness) &
!$OMP private(nominalDepth,totalThickness, &
!$OMP zNew,dh,zOld)
do j = G%jsc-1,G%jec+1
do i = G%isc-1,G%iec+1

Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module MOM
use MOM_variables, only: thermo_var_ptrs

! Infrastructure modules
use MOM_checksums, only : MOM_checksums_init, hchksum, uchksum, vchksum
use MOM_debugging, only : MOM_debugging_init, hchksum, uchksum, vchksum
use MOM_checksum_packages, only : MOM_thermo_chksum, MOM_state_chksum, MOM_accel_chksum
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_SUBCOMPONENT
Expand Down Expand Up @@ -90,7 +90,7 @@ module MOM
use MOM_EOS, only : EOS_init
use MOM_EOS, only : gsw_sp_from_sr, gsw_pt_from_ct
use MOM_EOS, only : calculate_density
use MOM_error_checking, only : check_redundant
use MOM_debugging, only : check_redundant
use MOM_grid, only : ocean_grid_type, set_first_direction
use MOM_grid, only : MOM_grid_init, MOM_grid_end
use MOM_hor_index, only : hor_index_type, hor_index_init
Expand Down Expand Up @@ -2065,7 +2065,7 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in, offline_tracer_mo
#endif
call callTree_waypoint("domains initialized (initialize_MOM)")

call MOM_checksums_init(param_file)
call MOM_debugging_init(param_file)
call diag_mediator_infrastructure_init()
call MOM_io_init(param_file)

Expand Down
61 changes: 47 additions & 14 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, CS)
ep_u, ep_v ! Additional pseudo-Coriolis terms in the Arakawa and Lamb
! discretization, in m-1 s-1 or m2 kg-1 s-1.
real, dimension(SZIB_(G),SZJB_(G)) :: &
dvdx,dudy, &! Contributions to the circulation around q-points (m2 s-1)
abs_vort, & ! Absolute vorticity at q-points, in s-1.
q2, & ! Relative vorticity over thickness.
max_fvq, & ! The maximum or minimum of the
Expand Down Expand Up @@ -195,7 +196,7 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, CS)
real :: h_tiny ! A very small thickness, in m or kg m-2.
real :: UHeff, VHeff ! More temporary variables, in m3 s-1 or kg s-1.
real :: QUHeff,QVHeff ! More temporary variables, in m3 s-2 or kg s-2.
integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
integer :: i, j, k, n, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz

! To work, the following fields must be set outside of the usual
! is to ie range before this subroutine is called:
Expand Down Expand Up @@ -237,16 +238,43 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, CS)
! are calculated. hq is second order accurate in space. Relative
! vorticity is second order accurate everywhere with free slip b.c.s,
! but only first order accurate at boundaries with no slip b.c.s.
! First calculate the contributions to the circulation around the q-point.
do J=Jsq-1,Jeq+1 ; do I=Isq-1,Ieq+1
dvdx(I,J) = v(i+1,J,k)*G%dyCv(i+1,J) - v(i,J,k)*G%dyCv(i,J)
dudy(I,J) = u(I,j+1,k)*G%dxCu(I,j+1) - u(I,j,k)*G%dxCu(I,j)
enddo ; enddo
! Adjust circulation components to relative vorticity on open boundaries.
if (associated(OBC)) then ; if (OBC%zero_vorticity .or. OBC%freeslip_vorticity) then
do n=1,OBC%number_of_segments
if (OBC%segment(n)%is_N_or_S) then
J = OBC%segment(n)%HI%JsdB
do I=OBC%segment(n)%HI%IsdB,OBC%segment(n)%HI%IedB
if (OBC%zero_vorticity) then
dvdx(I,J) = 0.
dudy(I,J) = 0.
elseif (OBC%freeslip_vorticity) then
dudy(I,J) = 0.
endif
enddo
elseif (OBC%segment(n)%is_E_or_W) then
I = OBC%segment(n)%HI%IsdB
do J=OBC%segment(n)%HI%JsdB,OBC%segment(n)%HI%JedB
if (OBC%zero_vorticity) then
dvdx(I,J) = 0.
dudy(I,J) = 0.
elseif (OBC%freeslip_vorticity) then
dvdx(I,J) = 0.
endif
enddo
endif
enddo
endif ; endif
do J=Jsq-1,Jeq+1 ; do I=Isq-1,Ieq+1
if (CS%no_slip ) then
relative_vorticity = (2.0-G%mask2dBu(I,J)) * &
((v(i+1,J,k)*G%dyCv(i+1,J) - v(i,J,k)*G%dyCv(i,J)) - &
(u(I,j+1,k)*G%dxCu(I,j+1) - u(I,j,k)*G%dxCu(I,j))) * &
relative_vorticity = (2.0-G%mask2dBu(I,J)) * (dvdx(I,J) - dudy(I,J)) * &
(G%IdxBu(I,J) * G%IdyBu(I,J)) ! ### Using G%IareaBu(I,J) changes answers.
else
relative_vorticity = G%mask2dBu(I,J) * &
((v(i+1,J,k)*G%dyCv(i+1,J) - v(i,J,k)*G%dyCv(i,J)) - &
(u(I,j+1,k)*G%dxCu(I,j+1) - u(I,j,k)*G%dxCu(I,j))) * &
relative_vorticity = G%mask2dBu(I,J) * (dvdx(I,J) - dudy(I,J)) * &
(G%IdxBu(I,J) * G%IdyBu(I,J)) ! ### Using G%IareaBu(I,J) changes answers.
endif
absolute_vorticity = G%CoriolisBu(I,J) + relative_vorticity
Expand Down Expand Up @@ -696,7 +724,7 @@ subroutine gradKE(u, v, h, uh, vh, KE, KEx, KEy, k, OBC, G, CS)
real :: um, up, vm, vp ! Temporary variables with units of m s-1.
real :: um2, up2, vm2, vp2 ! Temporary variables with units of m2 s-2.
real :: um2a, up2a, vm2a, vp2a ! Temporary variables with units of m4 s-2.
integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz
integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, n

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
Expand Down Expand Up @@ -747,12 +775,17 @@ subroutine gradKE(u, v, h, uh, vh, KE, KEx, KEy, k, OBC, G, CS)
enddo ; enddo

if (associated(OBC)) then
do j=js,je ; do I=Isq,Ieq
if (OBC%OBC_segment_u(I,j)>0) KEx(I,j) = 0.
enddo ; enddo
do J=Jsq,Jeq ; do i=is,ie
if (OBC%OBC_segment_v(i,J)>0) KEy(i,J) = 0.
enddo ; enddo
do n=1,OBC%number_of_segments
if (OBC%segment(n)%is_N_or_S) then
do i=OBC%segment(n)%HI%isd,OBC%segment(n)%HI%ied
KEy(i,OBC%segment(n)%HI%JsdB) = 0.
enddo
elseif (OBC%segment(n)%is_E_or_W) then
do j=OBC%segment(n)%HI%jsd,OBC%segment(n)%HI%jed
KEx(OBC%segment(n)%HI%IsdB,j) = 0.
enddo
endif
enddo
endif

end subroutine gradKE
Expand Down

0 comments on commit 4f912fd

Please sign in to comment.