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

Refactor mc ica #12

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
344337f
Added cmake-based build system
FrostyMike Dec 1, 2020
49981f4
Merge pull request #1 from FrostyMike/add_outofsource_build
FrostyMike Dec 2, 2020
cb9af29
Added missing file
FrostyMike Dec 2, 2020
0ff01f6
-
FrostyMike Dec 2, 2020
782123e
Added build type to project name
FrostyMike Dec 2, 2020
75dca0d
Fixed newer cmake errors
Dec 2, 2020
3c37e84
Added XML driver report
Dec 16, 2020
dbf3953
Removed old file
Dec 16, 2020
f1a2c6c
Added reference ci tests
Dec 16, 2020
d7072f6
Added tolerance tests
Dec 16, 2020
a1a091f
Moved tolerance reference testcases
Dec 17, 2020
359d148
Added CPU regression tests
Dec 17, 2020
185a4a2
Fixed cmake NETCDF library
FrostyMike Jan 14, 2021
37fdb38
Fixed PGI compilation
FrostyMike Jan 14, 2021
d53b798
radiation() replaced if with select
FrostyMike Jan 18, 2021
c7d11c9
Refactored solver type enum
FrostyMike Jan 18, 2021
68cd02a
Split radiation_single_level::get_albedos into 2 subroutines to reduc…
FrostyMike Jan 18, 2021
ef219b1
Gfortran compilation fix
Jan 20, 2021
8f1099e
Split radiation_ifs_rrtm::gas_optics into 2 subroutines
Jan 20, 2021
08c18e2
Split radiation_monochromatic::gas_optics into 2 subroutines
Jan 20, 2021
7b8bb48
Split radiation_cloud_optics::cloud_optics into 2 subroutines
Jan 21, 2021
5ceaff7
Split radiation_monochromatic::cloud_optics into 2 subroutines
Jan 21, 2021
58a7c58
Split radiation_aerosol_optics::add_aerosol_optics into 2 subroutines
Jan 21, 2021
9285a07
Split radiation_aerosol_optics::add_aerosol_optics into 2 subroutines…
Jan 21, 2021
ccd0021
Made radiation_interface::radiation() non-recursive
Jan 21, 2021
7db6598
Split radiation_flux::flux_type::calc_surface_spectral into 2 subrout…
Jan 21, 2021
270c3d8
Split radiation::radiation_run into 2 subroutines
Jan 21, 2021
98848a6
Parallelized radiation::radiation_run()
Jan 21, 2021
bbf35e0
Cray compilation fixes
Jan 22, 2021
a33493f
Driver fix: honor block size in serial mode
FrostyMike Jan 24, 2021
75af848
Gfortran build fix
FrostyMike Jan 24, 2021
3840a61
Print fix
FrostyMike Jan 24, 2021
52c7e89
Made array reshaping explicit in rttm
FrostyMike Jan 24, 2021
09f799c
Vectorized radiation_aerosol_optics::add_aerosol_optics_sw
FrostyMike Jan 24, 2021
6cfcfc6
Moved reordering routines into separate module
Jan 25, 2021
e85dd8f
Replaced reshape with explicit transpositions
FrostyMike Jan 26, 2021
b916d72
Added 2 dim reversal util
FrostyMike Jan 27, 2021
462949b
MovFixed bugs in radiation_utils::reverse_dim_2
Jan 27, 2021
5dd434f
Added script calculating size of IO data
Jan 27, 2021
e5c3a33
Added script calculating size of the stack for radiation_run_sw
Jan 28, 2021
6da5f74
Added script calculating size of the stack for radiation_run_lw
Jan 28, 2021
bdb42c8
Added GPU demo app
FrostyMike Jan 29, 2021
b8c43f6
Added GPU demo functionality
FrostyMike Jan 29, 2021
9aeaad5
Refactored gpu_demo into module; added LW functionality
FrostyMike Jan 29, 2021
a7b9635
Merge branch 'refactor_McICA' of https://github.com/MeteoSwiss-APN/ec…
Jan 29, 2021
25ae9f3
Removed OpenMP from gpu_demo
FrostyMike Jan 31, 2021
3c23069
Gpu demo compile fix
FrostyMike Feb 1, 2021
f2660a3
Tsa build fixes
Feb 1, 2021
4de7850
Tsa build fixes (2)
Feb 1, 2021
9d54844
Added memory usage printout to gpu_demo
Feb 1, 2021
bb4f265
Merge branch 'refactor_McICA' of https://github.com/MeteoSwiss-APN/ec…
Feb 1, 2021
763cfc5
Added missing file to git
Feb 2, 2021
ee4d962
Merge branch 'refactor_McICA' of https://github.com/MeteoSwiss-APN/ec…
Feb 2, 2021
14ec502
Added memory pool demo program
Feb 2, 2021
088676c
Removed reinterpret casts and pointer arithmetic from mempool_demo
FrostyMike Feb 2, 2021
fced66b
Added build script for mempool_demo
FrostyMike Feb 2, 2021
e5f84f3
mempool_demo: moved array functions to the same model
FrostyMike Feb 3, 2021
606b30e
mempool_demo: added openacc
FrostyMike Feb 4, 2021
b6c867a
Added functor_demo
FrostyMike Feb 4, 2021
1923596
Added block length tests
Feb 4, 2021
dfd9583
Added block test plot script
Feb 5, 2021
1061cf7
Added script for combining block test len results
Feb 5, 2021
f54b751
Added omp figure to block test plot script
Feb 5, 2021
532d451
Removed py-venv creation from default build
FrostyMike Feb 15, 2021
8fd1c20
Added support for OpenACC to PGI build
FrostyMike Feb 15, 2021
333b60c
Removed dr hook from mcica_lw routines
FrostyMike Feb 15, 2021
f469013
Removed disabled code paths from mcica_lw
FrostyMike Feb 15, 2021
0ed7f42
Turned mcica_lw n_g_lw into a constant
FrostyMike Feb 15, 2021
6af7b7f
Refactored solver_mcica_lw to process one column
FrostyMike Feb 15, 2021
a98dae3
Moved cloud_generator in front of solver_mcica_lw
FrostyMike Feb 16, 2021
07335d2
Added OpenACC to solver_mcica_lw_col
FrostyMike Feb 16, 2021
838d588
Added OpenACC workers to solver_mcica_lw_col
FrostyMike Feb 16, 2021
9e294ba
Added OpenACC to solver_mcica_lw_col (2)
FrostyMike Feb 16, 2021
d2eafac
Added OpenACC to solver_mcica_lw_col (3)
FrostyMike Feb 16, 2021
0651a60
Added gang-level OpenACC to solver_mcica_lw; Increased cuda heap size…
FrostyMike Feb 16, 2021
b565b16
acc_get_device_num fix
FrostyMike Feb 17, 2021
9763ab9
Added GPU registers limit
FrostyMike Feb 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made array reshaping explicit in rttm
FrostyMike committed Jan 24, 2021
commit 52c7e89e52a8d1330073a45726ddeb3f8b6b4842
35 changes: 19 additions & 16 deletions ifsrrtm/rrtm_gas_optical_depth.F90
Original file line number Diff line number Diff line change
@@ -68,13 +68,15 @@ SUBROUTINE RRTM_GAS_OPTICAL_DEPTH(KIDIA,KFDIA,KLEV,POD,PAVEL, PCOLDRY,PCOLBRD,PW
& PRAT_N2OCO2(KIDIA:KFDIA,KLEV),PRAT_N2OCO2_1(KIDIA:KFDIA,KLEV), &
& PRAT_O3CO2(KIDIA:KFDIA,KLEV),PRAT_O3CO2_1(KIDIA:KFDIA,KLEV)

REAL(KIND=JPRB) :: ZTAU (KIDIA:KFDIA,JPGPT,KLEV)
REAL(KIND=JPRB) :: ZTAU(KIDIA:KFDIA,JPGPT,KLEV)
REAL(KIND=JPRB) :: ZTAU_REORDERED(KLEV,JPGPT,KIDIA:KFDIA)
REAL(KIND=JPRB) :: ZTF

INTEGER(KIND=JPIM) :: JI, ITR, JLEV
INTEGER(KIND=JPIM) :: JLON
INTEGER(KIND=JPIM) :: JG, ITR, JLEV
INTEGER(KIND=JPIM) :: JCOL

REAL(KIND=JPRB) :: ZHOOK_HANDLE
INTEGER :: NCOL

#include "rrtm_taumol1.intfb.h"
#include "rrtm_taumol10.intfb.h"
@@ -175,21 +177,22 @@ SUBROUTINE RRTM_GAS_OPTICAL_DEPTH(KIDIA,KFDIA,KLEV,POD,PAVEL, PCOLDRY,PCOLBRD,PW
! print*,'ZTAU15= ',sum(ZTAU(:,137:138,:),2)
! print*,'ZTAU16= ',sum(ZTAU(:,139:140,:),2)

ZTAU_REORDERED = reshape(ZTAU, shape(ZTAU_REORDERED), order=(/3, 2, 1/))
POD = reshape(ZTAU_REORDERED, shape(POD), order=(/2, 1, 3/))

!- Loop over g-channels.
DO JLEV = 1, KLEV
!cdir unroll=4
DO JI = 1, JPGPT
DO JLON = KIDIA, KFDIA
POD(JI,JLEV,JLON) = ZTAU(JLON,JI,JLEV)

! ZTF = ZTAU(JLON,JI,JLEV)*1.66_jprb/(BPADE+ZTAU(JLON,JI,JLEV)*1.66_jprb)
! ITR=INT(5.E+03_JPRB*ZTF+0.5_JPRB)
! write(37,*) pod(ji,jlev,jlon), 1.0_JPRB - TRANS(ITR), ztf

ENDDO
ENDDO
ENDDO
!DO JLEV = 1, KLEV
! DO JG = 1, JPGPT
! DO JCOL = KIDIA, KFDIA
! POD(JG,JLEV,JCOL) = ZTAU(JCOL,JG,JLEV)

!! ZTF = ZTAU(JLON,JI,JLEV)*1.66_jprb/(BPADE+ZTAU(JLON,JI,JLEV)*1.66_jprb)
!! ITR=INT(5.E+03_JPRB*ZTF+0.5_JPRB)
!! write(37,*) pod(ji,jlev,jlon), 1.0_JPRB - TRANS(ITR), ztf

! ENDDO
! ENDDO
!ENDDO
! -----------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('RRTM_GAS_OPTICAL_DEPTH',1,ZHOOK_HANDLE)
33 changes: 17 additions & 16 deletions radiation/radiation_ifs_rrtm.F90
Original file line number Diff line number Diff line change
@@ -464,9 +464,9 @@ subroutine gas_optics_sw(ncol,nlev,istartcol,iendcol, &

! SRTM_GAS_OPTICAL_DEPTH will not initialize profiles when the sun
! is below the horizon, so we do it here
ZOD_SW(istartcol:iendcol,:,:) = 0.0_jprb
ZSSA_SW(istartcol:iendcol,:,:) = 0.0_jprb
ZINCSOL(istartcol:iendcol,:) = 0.0_jprb
ZOD_SW = 0.0_jprb
ZSSA_SW = 0.0_jprb
ZINCSOL = 0.0_jprb

CALL SRTM_GAS_OPTICAL_DEPTH &
&( istartcol, iendcol , nlev , ZONEMINUS_ARRAY,&
@@ -516,14 +516,12 @@ subroutine gas_optics_sw(ncol,nlev,istartcol,iendcol, &
end do
else
! G points have not been reordered
ZSSA_SW = ZSSA_SW(:, nlev:1:-1, :)
ssa_sw = reshape(ZSSA_SW, shape(ssa_sw), order=(/3, 2, 1/))
ZOD_SW = ZOD_SW(:, nlev:1:-1, :)
od_sw = reshape(ZOD_SW, shape(od_sw), order=(/3, 2, 1/))
od_sw = max(config%min_gas_od_sw, od_sw)
do jg = 1,config%n_g_sw
do jlev = 1,nlev
do jcol = istartcol,iendcol
! Check for negative optical depth
od_sw (jg,nlev+1-jlev,jcol) = max(config%min_gas_od_sw, ZOD_SW(jcol,jlev,jg))
ssa_sw(jg,nlev+1-jlev,jcol) = ZSSA_SW(jcol,jlev,jg)
end do
end do
if (present(incoming_sw)) then
incoming_sw(jg,:) &
& = incoming_sw_scale(:) * ZINCSOL(:,jg)
@@ -809,12 +807,15 @@ subroutine gas_optics_lw(ncol,nlev,istartcol,iendcol, &
end do
else
! G points have not been reordered
do jcol = istartcol,iendcol
do jlev = 1,nlev
! Check for negative optical depth
od_lw(:,jlev,jcol) = max(config%min_gas_od_lw, ZOD_LW(:,nlev+1-jlev,jcol))
end do
end do
od_lw = ZOD_LW
od_lw = od_lw(:,nlev:1:-1,:)
od_lw = max(config%min_gas_od_lw, od_lw)
! do jcol = istartcol,iendcol
! do jlev = 1,nlev
! ! Check for negative optical depth
! od_lw(:,jlev,jcol) = max(config%min_gas_od_lw, ZOD_LW(:,nlev+1-jlev,jcol))
! end do
! end do
end if

if (lhook) call dr_hook('radiation_ifs_rrtm:gas_optics_lw',1,hook_handle)