Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch of fesom2.6 including recom and tracer parallelisation #681

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

a270105
Copy link
Collaborator

@a270105 a270105 commented Jan 29, 2025

Tracer parallelisation can be switched on by __usetp in fesom2/src/CMakeLists.txt and onlye used when recom is on.

ogurses and others added 8 commits October 15, 2024 15:08
Define new variables to track tracer changes
due to advection and diffusion.

We want to save for now diffusion and advection
contribution to the tracer changes. Horizontal and
vertical diffusion includes Redi
parametrization (if it is set .true.).
Fill __ciso directive to ensure that
carbon isotope code works. Medusa interface is
added.
@a270105
Copy link
Collaborator Author

a270105 commented Jan 29, 2025

By compilation I found an issue regrading new compilations. I need to manually delete the executable file fesom.x in fesom2.build/bin and then compile the model. Otherwise, after a successful compilation I will still find the old fesom.x in fesom2/bin.

Copy link
Collaborator

@JanStreffing JanStreffing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of review:
There were a few places that need changing, some that may not need to change but would require a closer look that everything is indeed ok. There are a number of style improvements to be made. All comment that start with ! kh date should start without the name and date. Same for !YY, !O:G !OG and !.OG. Git blame can tell you this info.

In addition to the standalone FESOM2 CI tests, this branch needs to be tested by me as part of AWI-CM3, by @ackerlar as part of AWI-ESM2, by @sebastianbeyer or @suvarchal as part of IFS-FESOM, by @mbutzin with active tracers. I'm assuming here, that you have already tested this branch with recom and without _usetp

CMakeLists.txt Outdated
@@ -15,7 +15,7 @@ set(OIFS_COUPLED OFF CACHE BOOL "compile fesom coupled to OpenIFS. (Also needs F
set(CRAY OFF CACHE BOOL "compile with cray ftn")
set(USE_ICEPACK OFF CACHE BOOL "compile fesom with the Iceapck modules for sea ice column physics.")
set(OPENMP_REPRODUCIBLE OFF CACHE BOOL "serialize OpenMP loops that are critical for reproducible results")
set(RECOM_COUPLED OFF CACHE BOOL "compile fesom including biogeochemistry, REcoM3")
set(RECOM_COUPLED ON CACHE BOOL "compile fesom including biogeochemistry, REcoM3")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be turned back for the main branch.

@@ -20,6 +20,9 @@ MODULE MOD_TRACER
real(kind=WP) :: tra_adv_pv = 1. ! a parameter to be used in horizontal advection (for QR4C it is the fraction of fourth-order contribution in the solution)
integer :: AB_order=2
integer :: ID
!___________________________________________________________________________
! TODO: Make it as a part of namelist.tra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done before more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to clarify with Özgür

src/cpl_driver.F90 Outdated Show resolved Hide resolved
src/cpl_driver.F90 Outdated Show resolved Hide resolved
src/cpl_driver.F90 Outdated Show resolved Hide resolved
src/fesom_module.F90 Show resolved Hide resolved
if(num_fesom_groups > 1) then
call MPI_Bcast(atm_net_fluxes_north(1), nrecv, MPI_DOUBLE_PRECISION, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
call MPI_Bcast(atm_net_fluxes_south(1), nrecv, MPI_DOUBLE_PRECISION, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
end if
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautification: alignment

@@ -252,28 +270,56 @@ subroutine restart(istep, nstart, ntotal, l_read, which_readr, ice, dynamics, tr
logical rawfiles_exist, binfiles_exist
logical, save :: initialized_raw = .false.
logical, save :: initialized_bin = .false.
integer mpierr

! integer mpierr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, since only partit%mpierr is used here

if (tracers%data(tr_num)%ID == 14) tracers%data(tr_num)%values(:,:) = tracers%data(tr_num)%values(:,:) * exp(-decay14 * dt)
if (tracers%data(tr_num)%ID == 39) tracers%data(tr_num)%values(:,:) = tracers%data(tr_num)%values(:,:) * exp(-decay39 * dt)

!YY: C14 seems to be calculated both in fesom and recom
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify with @mbutzin

@@ -270,10 +389,93 @@ subroutine solve_tracers_ale(ice, dynamics, tracers, partit, mesh)
end if
call exchange_nod(tracers%data(tr_num)%values(:,:), partit)
!$OMP BARRIER
end do
! end do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm that now needed anymore. I can't see right now where the start of the loop was removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed here but moved to L424.

@JanStreffing
Copy link
Collaborator

In addition to the changes of the review, the merge conflicts should be solved. Most of them look like simple double additions of new features that both have to be kept. e.g. parallel tracers and icebergs.

@JanStreffing JanStreffing added the enhancement New feature or request label Feb 3, 2025
@ackerlar
Copy link
Collaborator

ackerlar commented Feb 5, 2025

Is there any template fesom-recom yaml that I can use for testing?

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 5, 2025

I get this error during compilation:

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(57): warning #5117: Bad # preprocessor line
#if defined(__async_icebergs)
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(59): warning #5117: Bad # preprocessor line
#endif
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(363): error #6784: The number of actual arguments cannot be greater than the number of dummy arguments.   [OASIS_INIT_COMP]
    CALL oasis_init_comp(comp_id, comp_name, ierror, num_program_groups = num_fesom_groups)
---------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(961): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
      call MPI_Bcast(action, 1, MPI_LOGICAL, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
------------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(961): error #6404: This name does not have a type, and must have an explicit type.   [MPIERR]
      call MPI_Bcast(action, 1, MPI_LOGICAL, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
------------------------------------------------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(976): error #6404: This name does not have a type, and must have an explicit type.   [MYDIM_NOD2D]
          call MPI_Bcast(data_array, myDim_nod2d, MPI_DOUBLE_PRECISION, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
-------------------------------------^
compilation aborted for /home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90 (code 1)
make[2]: *** [src/CMakeFiles/fesom.dir/build.make:205: src/CMakeFiles/fesom.dir/cpl_driver.F90.o] Error 1

@a270105
Copy link
Collaborator Author

a270105 commented Feb 5, 2025

I am still testing the code. So far I can run ocean-only without __usetp in CMakeLists and compile the model with __usetp. But I have not yet tested the coupled setup.

@a270105
Copy link
Collaborator Author

a270105 commented Feb 5, 2025

I get this error during compilation:

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(57): warning #5117: Bad # preprocessor line
#if defined(__async_icebergs)
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(59): warning #5117: Bad # preprocessor line
#endif
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(363): error #6784: The number of actual arguments cannot be greater than the number of dummy arguments.   [OASIS_INIT_COMP]
    CALL oasis_init_comp(comp_id, comp_name, ierror, num_program_groups = num_fesom_groups)
---------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(961): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
      call MPI_Bcast(action, 1, MPI_LOGICAL, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
------------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(961): error #6404: This name does not have a type, and must have an explicit type.   [MPIERR]
      call MPI_Bcast(action, 1, MPI_LOGICAL, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
------------------------------------------------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(976): error #6404: This name does not have a type, and must have an explicit type.   [MYDIM_NOD2D]
          call MPI_Bcast(data_array, myDim_nod2d, MPI_DOUBLE_PRECISION, 0, MPI_COMM_FESOM_SAME_RANK_IN_GROUPS, MPIerr)
-------------------------------------^
compilation aborted for /home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90 (code 1)
make[2]: *** [src/CMakeFiles/fesom.dir/build.make:205: src/CMakeFiles/fesom.dir/cpl_driver.F90.o] Error 1

I just compiled it with FESOM_COUPLED ON and didn't get any error. Did you compile the model with esm-tools?

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 5, 2025

@a270105 yes, I used esm_tools: esm_master get-awiesm-2.6, changed the FESOM branch to fesom2.6_recom_tp and then esm_master comp-awiesm-2.6

which oasis version are you using?

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 5, 2025

I got at least rid of this error

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/cpl_driver.F90(363): error #6784: The number of actual arguments cannot be greater than the number of dummy arguments.   [OASIS_INIT_COMP]
    CALL oasis_init_comp(comp_id, comp_name, ierror, num_program_groups = num_fesom_groups)

when switching to oasis branch feat/multi-group-support. Before I used 2.8mct-awiesm-2.1. However, the other errors remain

call cpl_oasis3mct_init(f%partit,f%partit%MPI_COMM_FESOM)
! call cpl_oasis3mct_init(f%partit,f%partit%MPI_COMM_FESOM)
! kh 02.12.21
#if defined(__recom) && defined(__usetp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"localCommunicator" is neither defined in fesom_module nor in MOD_PARTIT. Should this really be "localCommunicator" or "f%partit%MPI_COMM_FESOM"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really answer this. These lines already exited in fesom2.5-recom and another earlier version where Özgür and I merged their complex recom version and my simpler paleo version. But I can't find them in my paleo version where Kai first time implemented tracer parallelisation. There this part of code is still in fvom_main.f90 and only contains:
#if defined (__oasis)

! kh 21.03.22 pass num_fesom_groups to coupler
call cpl_oasis3mct_init(MPI_COMM_FESOM, num_fesom_groups)
#endif
t1 = MPI_Wtime()

call par_init

......

So I think it should be for the case with tracer parallelisation:
call cpl_oasis3mct_init(f%partit, f%partit%MPI_COMM_FESOM, num_fesom_groups)

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 5, 2025

FESOM compiled for me with some minor changes in MPI calls. I also changed

-        call cpl_oasis3mct_init(f%partit, f%partit%localCommunicator, num_fesom_groups)
+        call cpl_oasis3mct_init(f%partit, f%partit%MPI_COMM_FESOM, num_fesom_groups)

in fesom_module as localCommunicator is not defined outside of cpl_driver. Please check whether this makes sense.

However, the model crashes as FESOM is missing some entries in namelist.config. Is there a recom specific namelist.config?

@a270105
Copy link
Collaborator Author

a270105 commented Feb 5, 2025

@a270105 yes, I used esm_tools: esm_master get-awiesm-2.6, changed the FESOM branch to fesom2.6_recom_tp and then esm_master comp-awiesm-2.6

which oasis version are you using?

@a270105 a270105 closed this Feb 5, 2025
@a270105 a270105 reopened this Feb 5, 2025
@a270105
Copy link
Collaborator Author

a270105 commented Feb 5, 2025

FESOM compiled for me with some minor changes in MPI calls. I also changed

-        call cpl_oasis3mct_init(f%partit, f%partit%localCommunicator, num_fesom_groups)
+        call cpl_oasis3mct_init(f%partit, f%partit%MPI_COMM_FESOM, num_fesom_groups)

in fesom_module as localCommunicator is not defined outside of cpl_driver. Please check whether this makes sense.

However, the model crashes as FESOM is missing some entries in namelist.config. Is there a recom specific namelist.config?

Do you compile with __usetp? If not, there is no additional entry needed in namelist.config.

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 6, 2025

Do you compile with __usetp? If not, there is no additional entry needed in namelist.config.

Yes, I set RECOM_COUPLED=ON which gives

if(${RECOM_COUPLED})
#   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __usetp)
#   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2)
   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __3Zoo2Det __coccos __usetp)
endif()

in src/CMakeLists.txt and __usetp should be used if I understand correctly.

@a270105
Copy link
Collaborator Author

a270105 commented Feb 6, 2025

Do you compile with __usetp? If not, there is no additional entry needed in namelist.config.

Yes, I set RECOM_COUPLED=ON which gives

if(${RECOM_COUPLED})
#   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __usetp)
#   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2)
   target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2 __3Zoo2Det __coccos __usetp)
endif()

in src/CMakeLists.txt and __usetp should be used if I understand correctly.

Yes, with that option you would need an additional part in namelst.config to control the tracer groups. Since the version with tracer parallelisation is still being tested, we should try first with the second option:

target_compile_definitions(${PROJECT_NAME} PRIVATE __recom USE_PRECISION=2)

@ackerlar
Copy link
Collaborator

ackerlar commented Feb 6, 2025

Without __usetp I get these errors during compilation:

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(59): warning #5117: Bad # preprocessor line
#endif
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS

@patrickscholz
Copy link
Contributor

patrickscholz commented Feb 6, 2025

Without __usetp I get these errors during compilation:

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(59): warning #5117: Bad # preprocessor line
#endif
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS

@ackerlar: I found some similar issues, when i was playing around on juwels last week with GCC compiler. There were different locations in the code where we tried to associate a pointer to a variable via the associate_part_ass.h and associate_mesh_ass.h file that wasnt allocated yet. The happend especially during the initialisation phase! You can try to use the extended debuggin compiler flags and also the namelist.config flag_debug=.True., to better track down where it happens.
I solved my issue by checking in associate_part_ass.h if the variable is already allocated befor the pointer is setted

if (allocated(partit%remPtr_nod2D)) then
   remPtr_nod2D  (1:npes)                => partit%remPtr_nod2D(:)
end if

@a270105
Copy link
Collaborator Author

a270105 commented Feb 6, 2025

Is there any template fesom-recom yaml that I can use for testing?

I created a new branch of esm-tools and added a new model 'awiesm-2.6-recom'. The branch is called awiesm-2.6-recom as well.

In config/couplings I included oasis3mct-2.8-paleodyn-multi-group-support in the components instead of oasis3mct-2.8-paleodyn (for awiesm-2.6). Otherwise it does not differ from awiesm-2.6 except for awiesm.yaml, fesom-2.6.yaml and recom.yaml. I can install (and compile) the model and still need to work on a runscript.
The relevant fesom namelists can be found in awiesm-2.6-recom/fesom-2.6/config/bin_2p1z1d. After testing I will put them into the default namelist dir.

@a270105
Copy link
Collaborator Author

a270105 commented Feb 7, 2025

Without __usetp I get these errors during compilation:

/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_mesh_ass.h(59): warning #5117: Bad # preprocessor line
#endif
-^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(2): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_WORLD]
MPI_COMM_FESOM_WORLD                => partit%MPI_COMM_FESOM_WORLD
^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6460: This is not a component name that is defined in the encompassing structure.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS
----------------------------------------------^
/home/a/a270124/model_codes/testing_and_debugging/awiesm-2.6/fesom-2.6/src/associate_part_ass.h(3): error #6795: The target must be of the same type and kind type parameters as the pointer.   [MPI_COMM_FESOM_SAME_RANK_IN_GROUPS]
MPI_COMM_FESOM_SAME_RANK_IN_GROUPS  => partit%MPI_COMM_FESOM_SAME_RANK_IN_GROUPS

Now I got these errors by compiling awiesm-2.6-recom as well. flag_debug is set to true and I didn't get more information.
These pointers are defined in associate_part_def.h when __recom and __usetp are both defined which happens through /src/CMakeLists. So with the default CMakeLists __usetp should not be defined and the pointers not used at all. There is no problem with compilation and simulation on albedo with the ocean-only fesom-2.6-recom. Maybe it is caused by different compilers that the directives don't work?

I tried with !DIR$ if defined(__recom) .AND. defined(__usetp) in both associate_part_def.h and associate_part_ass.h (instead of #if defined(__recom) && defined(__usetp)) and can (almost) compile the model. I got then this error:
[100%] Built target fesom.x Install the project... -- Install configuration: "Release" -- Installing: /usr/local/lib64/libfesom.so CMake Error at src/cmake_install.cmake:51 (file): file INSTALL cannot copy file "/work/ab0995/a270105/esm_code/awiesm-2.6-recom/fesom-2.6/build/lib/libfesom.so" to "/usr/local/lib64/libfesom.so": Permission denied. Call Stack (most recent call first): cmake_install.cmake:47 (include)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants