Skip to content

Commit

Permalink
Merge branch 'refactoring' into tmp_refactoring_with_icb
Browse files Browse the repository at this point in the history
  • Loading branch information
koldunovn authored Sep 22, 2023
2 parents 2444481 + 1979974 commit e13d614
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 68 deletions.
9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
FESOM2 documentation
====================

The Finite volumE Sea Ice-Ocean Model (FESOM2).

Multi-resolution ocean general circulation model that solves
the equations of motion describing the ocean and sea ice using
finite-volume methods on unstructured computational grids. The
model is developed and supported by researchers at the Alfred
Wegener Institute, Helmholtz Centre for Polar and Marine
Research (AWI), in Bremerhaven, Germany.

Authors
-------

Expand Down
21 changes: 17 additions & 4 deletions lib/parms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,35 @@ project(parms C)
set(src_home ${CMAKE_CURRENT_LIST_DIR}) # path to src directory starting from the dir containing our CMakeLists.txt
file(GLOB all_sources ${src_home}/src/*.c ${src_home}/src/DDPQ/*.c)

include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/FindBLAS.cmake")
find_package(BLAS) # standard way to find blas
if( NOT BLAS_FOUND) # try older way to find blas
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/FindBLAS.cmake")
endif()

# create our library (set its name to name of this project)
if(${BUILD_FESOM_AS_LIBRARY})
add_library(${PROJECT_NAME} ${all_sources})
else()
add_library(${PROJECT_NAME} ${all_sources})
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE PARMS USE_MPI REAL=double DBL FORTRAN_UNDERSCORE VOID_POINTER_SIZE_8 HAS_BLAS)

if(${BLAS_FOUND})
message("BLAS FOUND ---------------------------")
target_compile_definitions(${PROJECT_NAME} PRIVATE PARMS USE_MPI REAL=double DBL FORTRAN_UNDERSCORE VOID_POINTER_SIZE_8 HAS_BLAS)
target_link_libraries(${PROJECT_NAME} INTERFACE ${BLAS_C_LIBRARIES} $ENV{UBUNTU_BLAS_LIBRARY})
else()
message("BLAS NOT FOUND ***********************")
target_compile_definitions(${PROJECT_NAME} PRIVATE PARMS USE_MPI REAL=double DBL FORTRAN_UNDERSCORE VOID_POINTER_SIZE_8)
target_link_libraries(${PROJECT_NAME} INTERFACE $ENV{UBUNTU_BLAS_LIBRARY})
endif()

target_include_directories(${PROJECT_NAME}
PRIVATE ${src_home}/src/../include ${src_home}/src/include
INTERFACE ${src_home}/src/../include
)
target_link_libraries(${PROJECT_NAME} INTERFACE ${BLAS_C_LIBRARIES} $ENV{UBUNTU_BLAS_LIBRARY})
if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
target_compile_options(${PROJECT_NAME} PRIVATE -no-prec-div -no-prec-sqrt -fast-transcendentals -fp-model precise)
target_compile_options(${PROJECT_NAME} PRIVATE -no-prec-div -no-prec-sqrt -fast-transcendentals -fp-model precise)

if(${FESOM_PLATFORM_STRATEGY} STREQUAL levante.dkrz.de )
target_compile_options(${PROJECT_NAME} PRIVATE -march=core-avx2 -mtune=core-avx2)
endif()
Expand Down
74 changes: 13 additions & 61 deletions src/ifs_interface/ifs_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -575,50 +575,6 @@ SUBROUTINE nemogcmcoup_lim2_get( mype, npes, icomm, &
nfield = nfield + 1
pgvcur(:) = zrecvnf(:,nfield)

! Pack u(v) surface currents on elements
!zsendnfUV(:,1)=fesom%dynamics%UV(1,1,1:myDim_elem2D)
!zsendnfUV(:,2)=fesom%dynamics%UV(2,1,1:myDim_elem2D) !UV includes eDim, leave those away here
!nfielduv = 2
!
!do elem=1, myDim_elem2D
!
! ! compute element midpoints
! elnodes=elem2D_nodes(:,elem)
! rlon=sum(coord_nod2D(1,elnodes))/3.0_wpIFS
! rlat=sum(coord_nod2D(2,elnodes))/3.0_wpIFS
!
! ! Rotate vectors to geographical coordinates (r2g)
! CALL vector_r2g(zsendnfUV(elem,1), zsendnfUV(elem,2), rlon, rlat, 0) ! 0-flag for rot. coord
!
!end do

#ifdef FESOM_TODO

! We need to sort out the non-unique global index before we
! can couple currents

! Interpolate: 'pgucur' and 'pgvcur' on Gaussian grid.
IF (lparintmultatm) THEN
CALL parinter_fld_mult( nfielduv, mype, npes, icomm, UVtogauss, &
& myDim_nod2D, zsendnfUV, &
& nopoints, zrecvnfUV )
ELSE
DO jf = 1, nfielduv
CALL parinter_fld( mype, npes, icomm, UVtogauss, &
& myDim_nod2D, zsendnfUV(:,jf), &
& nopoints, zrecvnfUV(:,jf) )
ENDDO
ENDIF
pgucur(:) = zrecvnfUV(:,1)
pgvcur(:) = zrecvnfUV(:,2)

#else

!pgucur(:) = 0.0
!pgvcur(:) = 0.0

#endif

END SUBROUTINE nemogcmcoup_lim2_get


Expand Down Expand Up @@ -862,24 +818,20 @@ SUBROUTINE nemogcmcoup_lim2_update( mype, npes, icomm, &
! Sort out incoming arrays from the IFS and put them on the ocean grid

! TODO
shortwave(:)=0. ! Done, updated below. What to do with shortwave over ice??
!longwave(:)=0. ! Done. Only used in stand-alone mode.
prec_rain(:)=0. ! Done, updated below.
prec_snow(:)=0. ! Done, updated below.
evap_no_ifrac=0. ! Done, updated below. This is evap over ocean, does this correspond to evap_tot?
sublimation=0. ! Done, updated below.
shortwave(:)=0.
!longwave(:)=0.
prec_rain(:)=0.
prec_snow(:)=0.
evap_no_ifrac=0.
sublimation=0.
!
ice_heat_flux=0. ! Done. This is qns__ice currently. Is this the non-solar heat flux? ! non solar heat fluxes below ! (qns)
oce_heat_flux=0. ! Done. This is qns__oce currently. Is this the non-solar heat flux?
ice_heat_flux=0.
oce_heat_flux=0.
!
!runoff(:)=0. ! not used apparently. What is runoffIN, ocerunoff?
!evaporation(:)=0.
!ice_thermo_cpl.F90: !---- total evaporation (needed in oce_salt_balance.F90)
!ice_thermo_cpl.F90: evaporation = evap_no_ifrac*(1.-a_ice) + sublimation*a_ice
stress_atmice_x=0. ! Done, taux_ice
stress_atmice_y=0. ! Done, tauy_ice
stress_atmoce_x=0. ! Done, taux_oce
stress_atmoce_y=0. ! Done, tauy_oce
stress_atmice_x=0.
stress_atmice_y=0.
stress_atmoce_x=0.
stress_atmoce_y=0.

! =================================================================== !
! Pack all arrays
Expand Down Expand Up @@ -1187,4 +1139,4 @@ SUBROUTINE nemogcmcoup_final
endif
CALL fesom_finalize

END SUBROUTINE nemogcmcoup_final
END SUBROUTINE nemogcmcoup_final
3 changes: 1 addition & 2 deletions src/ifs_interface/ifs_notused.F90
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ SUBROUTINE nemogcmcoup_update_add( mype, npes, icomm, &
! Local variables

if(fesom%mype==0) then
WRITE(0,*)'nemogcmcoup_update_add should not be called when coupling to fesom. Commented ABORT. Proceeding...'
WRITE(0,*)'In nemogcmcoup_update_add FESOM dummy routine. Proceeding...'
!CALL abort
endif

Expand Down Expand Up @@ -304,4 +304,3 @@ SUBROUTINE nemogcmcoup_wam_update_stress( mype, npes, icomm, npoints, &
CALL abort

END SUBROUTINE nemogcmcoup_wam_update_stress

2 changes: 1 addition & 1 deletion src/write_step_info.F90
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ subroutine check_blowup(istep, ice, dynamics, tracers, partit, mesh)
end if ! --> if ( .not. trim(which_ALE)=='linfs' .and. ...


do nz=1,nlevels_nod2D(n)-1
do nz=ulevels_nod2D(n),nlevels_nod2D(n)-1
!_______________________________________________________________
! check temp
if ( (tracers%data(1)%values(nz, n) /= tracers%data(1)%values(nz, n)) .or. &
Expand Down

0 comments on commit e13d614

Please sign in to comment.