Skip to content

Commit

Permalink
Merge pull request #4412 from jedwards4b/porttopython3.10
Browse files Browse the repository at this point in the history
port to python 3.10, remove depricated shr_file_ log stuff
  • Loading branch information
jedwards4b authored May 2, 2023
2 parents 058569f + 5104ec5 commit 370baf4
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 83 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
container: jasonb87/cime:latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.8', '3.9', '3.10']
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -183,6 +183,8 @@ jobs:
if: ${{ failure() }}
shell: bash
run: tar -czvf /testing-logs-${GITHUB_RUN_NUMBER}.tar.gz /storage/cases/
# How to download artifacts:
# https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts
- name: Upload testing logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions CIME/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def generate_makefile_macro(case, caseroot):
"gptl",
"csm_share",
"csm_share_cpl7",
"mpi-serial",
]
)
cmake_macro = os.path.join(caseroot, "Macros.cmake")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module atm_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down Expand Up @@ -270,7 +270,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

! Reset shr logging to original values
call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeAdvertise

Expand All @@ -295,8 +295,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS

! Reset shr logging to my log file
call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logUnit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logUnit)

! generate the mesh
call NUOPC_CompAttributeGet(gcomp, name='mesh_atm', value=cvalue, rc=rc)
Expand Down Expand Up @@ -349,7 +349,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeRealize

Expand All @@ -375,8 +375,8 @@ subroutine ModelAdvance(gcomp, rc)
end if
call memcheck(subname, 3, mastertask)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

!--------------------------------
! Pack export state
Expand Down Expand Up @@ -405,7 +405,7 @@ subroutine ModelAdvance(gcomp, rc)
endif
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine ModelAdvance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module glc_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ice_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down Expand Up @@ -281,7 +281,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! Reset shr logging to original values
!----------------------------------------------------------------------------

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeAdvertise

Expand All @@ -305,8 +305,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! Reset shr logging to my log file
!----------------------------------------------------------------------------

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logUnit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logUnit)

!--------------------------------
! generate the mesh
Expand Down Expand Up @@ -368,7 +368,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeRealize

Expand All @@ -390,8 +390,8 @@ subroutine ModelAdvance(gcomp, rc)
call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO, rc=rc)
call memcheck(subname, 3, mastertask)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

!--------------------------------
! Pack export state
Expand All @@ -416,7 +416,7 @@ subroutine ModelAdvance(gcomp, rc)
endif
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO, rc=rc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module lnd_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down Expand Up @@ -292,7 +292,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! Reset shr logging to original values
!----------------------------------------------------------------------------

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeAdvertise

Expand All @@ -319,8 +319,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! Reset shr logging to my log file
!----------------------------------------------------------------------------

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logUnit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logUnit)

!--------------------------------
! generate the mesh
Expand Down Expand Up @@ -382,7 +382,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO, rc=rc)

Expand All @@ -406,8 +406,8 @@ subroutine ModelAdvance(gcomp, rc)
call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO, rc=rc)
call memcheck(subname, 3, mastertask)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

!--------------------------------
! Pack export state
Expand All @@ -432,7 +432,7 @@ subroutine ModelAdvance(gcomp, rc)
endif
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO, rc=rc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ocn_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down Expand Up @@ -238,7 +238,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

! Reset shr logging to original values
call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeAdvertise

Expand All @@ -260,8 +260,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS

! Reset shr logging to my log file
call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

! generate the mesh
call NUOPC_CompAttributeGet(gcomp, name='mesh_ocn', value=cvalue, rc=rc)
Expand Down Expand Up @@ -306,7 +306,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeRealize

Expand All @@ -328,8 +328,8 @@ subroutine ModelAdvance(gcomp, rc)

call memcheck(subname, 3, mastertask)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

! Pack export state
call NUOPC_ModelGet(gcomp, modelClock=clock, exportState=exportState, rc=rc)
Expand All @@ -343,7 +343,7 @@ subroutine ModelAdvance(gcomp, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine ModelAdvance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module rof_comp_nuopc
use NUOPC_Model , only : NUOPC_ModelGet, SetVM
use shr_sys_mod , only : shr_sys_abort
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use shr_log_mod , only : shr_log_getlogunit, shr_log_setlogunit
use dead_methods_mod , only : chkerr, state_setscalar, state_diagnose, alarmInit, memcheck
use dead_methods_mod , only : set_component_logging, get_component_instance, log_clock_advance
use dead_nuopc_mod , only : dead_read_inparms, ModelInitPhase, ModelSetRunClock
Expand Down Expand Up @@ -229,7 +229,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! Reset shr logging to original values
!----------------------------------------------------------------------------

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeAdvertise

Expand All @@ -251,8 +251,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS

! Reset shr logging to my log file
call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logUnit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logUnit)


! generate the mesh
Expand Down Expand Up @@ -304,7 +304,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

end subroutine InitializeRealize

Expand All @@ -329,8 +329,8 @@ subroutine ModelAdvance(gcomp, rc)
end if
call memcheck(subname, 3, mastertask)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (logunit)
call shr_log_getLogUnit (shrlogunit)
call shr_log_setLogUnit (logunit)

! Pack export state
call NUOPC_ModelGet(gcomp, modelClock=clock, exportState=exportState, rc=rc)
Expand All @@ -348,7 +348,7 @@ subroutine ModelAdvance(gcomp, rc)
endif
endif

call shr_file_setLogUnit (shrlogunit)
call shr_log_setLogUnit (shrlogunit)

if (dbug > 5) then
call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO, rc=rc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module dead_methods_mod
use NUOPC_Model , only : NUOPC_ModelGet
use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_sys_mod , only : shr_sys_abort
use shr_file_mod , only : shr_file_setlogunit, shr_file_getLogUnit
use shr_log_mod , only : shr_log_setlogunit, shr_log_getLogUnit

implicit none
private
Expand Down Expand Up @@ -157,7 +157,7 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)
logUnit = 6
endif

call shr_file_setLogUnit (logunit)
call shr_log_setLogUnit (logunit)

call ESMF_GridCompGet(gcomp, name=name, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand Down
Loading

0 comments on commit 370baf4

Please sign in to comment.