Skip to content

Commit

Permalink
Merge pull request NorESMhub#374 from mvertens/feature/add_netcdf_set…
Browse files Browse the repository at this point in the history
…ting

Fixes having BLOM run with newer version of CMEPS and fixes threading compilation
  • Loading branch information
matsbn authored Aug 16, 2024
2 parents 737c8f2 + f009062 commit 42441ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
3 changes: 3 additions & 0 deletions cime_config/namelist_definition_blom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@
<values>
<value>0</value>
<value pio_netcdf_format_ocn="64bit_offset">1</value>
<value pio_netcdf_format_ocn="64bit_data">1</value>
</values>
<desc>Format of restart file (valid arguments are 0 for classic,</desc>
</entry>
Expand Down Expand Up @@ -1490,6 +1491,7 @@
<values>
<value>0,0,0</value>
<value pio_netcdf_format_ocn="64bit_offset">1,1,1</value>
<value pio_netcdf_format_ocn="64bit_data">1,1,1</value>
</values>
<desc>
netcdf format (valid arguments are 0 for classic, 1 for 64-bit
Expand Down Expand Up @@ -5186,6 +5188,7 @@
<values>
<value>0,0,0</value>
<value pio_netcdf_format_ocn="64bit_offset">1,1,1</value>
<value pio_netcdf_format_ocn="64bit_data">1,1,1</value>
</values>
<desc>add desc</desc>
</entry>
Expand Down
36 changes: 16 additions & 20 deletions phy/mod_nctools.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
fldmax = -abs(fillr8)

if (mskflg == 1) then
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax)
!$omp private(j,i,ij,ijk)
!$omp parallel do private(j,i,ij,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1284,8 +1284,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else if (mskflg == 2) then
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax)
!$omp private(j,i,ij,ijk)
!$omp parallel do private(j,i,ij,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1300,8 +1300,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax)
!$omp private(j,i,ijk)
!$omp parallel do private(j,i,ij,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand Down Expand Up @@ -1350,8 +1350,7 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)

! --- Prepare and write output field
if (mskflg == 1) then
!$omp parallel do
!$omp private(j,i,ij)
!$omp parallel do private(j,i,ij)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1366,8 +1365,7 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else if (mskflg == 2) then
!$omp parallel do
!$omp private(j,i,ij,ijk)
!$omp parallel do private(j,i,ij,ijk)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1383,8 +1381,7 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else
!$omp parallel do
!$omp private(j,i,ijk)
!$omp parallel do private(j,i,ijk)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand Down Expand Up @@ -1446,8 +1443,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
fldmin = abs(fillr8)
fldmax = -abs(fillr8)
if (mskflg == 1) then
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax) &
!$omp private(j,i,ij,ijk)
!$omp parallel do private(j,i,ij,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1462,8 +1459,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else if (mskflg == 2) then
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax) &
!$omp private(j,i,ij,ijk)
!$omp parallel do private(j,i,ij,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand All @@ -1478,8 +1475,8 @@ subroutine ncpack(vnm,dims,fld,msk,mskflg,sfac,offs)
end do
!$omp end parallel do
else
!$omp parallel do reduction(min:fldmin) reduction(max:fldmax) &
!$omp private(j,i,ijk)
!$omp parallel do private(j,i,ijk) &
!$omp reduction(min:fldmin) reduction(max:fldmax)
do k = 1,kd
do j = 1,jj
do i = 1,ii
Expand Down Expand Up @@ -1914,8 +1911,7 @@ subroutine nccopa(vnm,dims,fld,msk,sfac,offs)

! --- Prepare and write output field
do k = 1,kd
!$omp parallel do
!$omp private(i,ij,ijk)
!$omp parallel do private(i,ij,ijk)
do j = 1,jj
do i = 1,ii
ij = i+nbdy+(idm+2*nbdy)*(j+nbdy-1)
Expand Down

0 comments on commit 42441ca

Please sign in to comment.