Skip to content

Commit

Permalink
Merge pull request #33 from eclare108213/move_constants2
Browse files Browse the repository at this point in the history
Move constants from ice_constants_colpkg.F90 to mpas_seaice_constants.F
  • Loading branch information
eclare108213 authored Sep 23, 2023
2 parents 9ed8e48 + 872ce33 commit 511c002
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 274 deletions.
31 changes: 18 additions & 13 deletions components/mpas-seaice/driver/ice_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,20 @@ module ice_comp_mct

! MPASSI modules
use seaice_analysis_driver
use seaice_column, only: seaice_column_reinitialize_fluxes, &
use seaice_column, only: seaice_column_reinitialize_fluxes, & !colpkg
seaice_column_coupling_prep
use seaice_constants
use seaice_constants, only: coupleAlarmID, &
seaiceFreshWaterFreezingPoint, &
seaiceDensityIce, &
seaiceDensitySnow, &
seaiceDensitySeaWater, &
seaiceGravity, &
seaiceLatentHeatMelting, &
seaiceReferenceSalinity, &
seaiceFrazilSalinityReduction, &
seaiceFrazilIcePorosity, &
pii

use seaice_core
use seaice_core_interface
use seaice_forcing
Expand All @@ -57,8 +68,6 @@ module ice_comp_mct
use seaice_time_integration
use seaice_error, only: seaice_check_critical_error

use ice_constants_colpkg, only: Tffresh, ice_ref_salinity, p001

use ice_colpkg, only: colpkg_sea_freezing_temperature

!
Expand Down Expand Up @@ -2571,7 +2580,7 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{
i2x_i % rAttr(index_i2x_Fioi_melth,n) = oceanHeatFlux(i)
i2x_i % rAttr(index_i2x_Fioi_swpen,n) = oceanShortwaveFlux(i)
i2x_i % rAttr(index_i2x_Fioi_meltw,n) = oceanFreshWaterFlux(i) + frazilMassAdjust(i)/ailohi
i2x_i % rAttr(index_i2x_Fioi_salt ,n) = oceanSaltFlux(i) + ice_ref_salinity*p001*frazilMassAdjust(i)/ailohi
i2x_i % rAttr(index_i2x_Fioi_salt ,n) = oceanSaltFlux(i) + seaiceReferenceSalinity*0.001_RKIND*frazilMassAdjust(i)/ailohi
i2x_i % rAttr(index_i2x_Fioi_taux ,n) = tauxo
i2x_i % rAttr(index_i2x_Fioi_tauy ,n) = tauyo
Expand Down Expand Up @@ -2760,10 +2769,6 @@ subroutine frazil_mass(freezingPotential, frazilMassFlux, seaSurfaceSalinity, &
liquidus_temperature_mush, &
enthalpy_mush
use ice_colpkg_shared, only: &
dSin0_frazil, &
phi_init
! !INPUT PARAMETERS:
real (kind=RKIND), intent(in) :: freezingPotential
real (kind=RKIND), intent(in) :: seaSurfaceSalinity
Expand All @@ -2789,12 +2794,12 @@ subroutine frazil_mass(freezingPotential, frazilMassFlux, seaSurfaceSalinity, &
if (freezingPotential > 0.0_RKIND) then
if (trim(config_thermodynamics_type) == "mushy") then ! mushy
if (seaSurfaceSalinity > 2.0_RKIND * dSin0_frazil) then
Si0new = seaSurfaceSalinity - dSin0_frazil
if (seaSurfaceSalinity > 2.0_RKIND * seaiceFrazilSalinityReduction) then
Si0new = seaSurfaceSalinity - seaiceFrazilSalinityReduction
else
Si0new = seaSurfaceSalinity**2 / (4.0_RKIND*dSin0_frazil)
Si0new = seaSurfaceSalinity**2 / (4.0_RKIND*seaiceFrazilSalinityReduction)
endif
Ti = liquidus_temperature_mush(Si0new/phi_init)
Ti = liquidus_temperature_mush(Si0new/seaiceFrazilIcePorosity)
qi0new = enthalpy_mush(Ti, Si0new)
else
qi0new = -seaiceDensityIce*seaiceLatentHeatMelting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module seaice_high_frequency_output
use mpas_dmpar
use mpas_timekeeping
use mpas_stream_manager
use ice_constants_colpkg

implicit none
private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ end subroutine seaice_precompute_miscellaneous!}}}

subroutine seaice_compute_miscellaneous(domain, instance, timeLevel, err)!{{{

use ice_constants_colpkg, only: &
awtvdr, &
awtidr, &
awtvdf, &
awtidf
use seaice_constants, only: &
seaiceAlbedoWtVisibleDirect, &
seaiceAlbedoWtNearIRDirect, &
seaiceAlbedoWtVisibleDiffuse, &
seaiceAlbedoWtNearIRDiffuse

!-----------------------------------------------------------------
!
Expand Down Expand Up @@ -345,10 +345,10 @@ subroutine seaice_compute_miscellaneous(domain, instance, timeLevel, err)!{{{
do iCell = 1, nCellsSolve

broadbandAlbedo(iCell) = &
(awtvdr * albedoVisibleDirectCell(iCell) + &
awtidr * albedoIRDirectCell(iCell) + &
awtvdf * albedoVisibleDiffuseCell(iCell) + &
awtidf * albedoIRDiffuseCell(iCell)) * &
(seaiceAlbedoWtVisibleDirect * albedoVisibleDirectCell(iCell) + &
seaiceAlbedoWtNearIRDirect * albedoIRDirectCell(iCell) + &
seaiceAlbedoWtVisibleDiffuse * albedoVisibleDiffuseCell(iCell) + &
seaiceAlbedoWtNearIRDiffuse * albedoIRDiffuseCell(iCell)) * &
iceAreaCellInitial(iCell)

enddo ! iCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,13 @@ subroutine fixed_regional_statistics(domain)
use seaice_mesh, only: &
seaice_interpolate_vertex_to_cell

use ice_constants_colpkg, only: &
awtvdr, &
awtidr, &
awtvdf, &
awtidf, &
rhoi, &
rhos
use seaice_constants, only: &
seaiceAlbedoWtVisibleDirect, &
seaiceAlbedoWtNearIRDirect, &
seaiceAlbedoWtVisibleDiffuse, &
seaiceAlbedoWtNearIRDiffuse, &
seaiceDensityIce, &
seaiceDensitySnow

type(domain_type), intent(inout) :: &
domain
Expand Down Expand Up @@ -1138,24 +1138,24 @@ subroutine fixed_regional_statistics(domain)
! kinetic energy
iSum = (iRegion-1) * nSums + 5
globalSumsIn(iSum) = globalSumsIn(iSum) + 0.5_RKIND * areaCell(iCell) * &
(snowVolumeCell(iCell) * rhos + iceVolumeCell(iCell) * rhoi) * &
(snowVolumeCell(iCell) * seaiceDensitySnow + iceVolumeCell(iCell) * seaiceDensityIce) * &
(uVelocityCell(iCell)**2 + vVelocityCell(iCell)**2)

! total mass (for RMS ice speed)
iSum = (iRegion-1) * nSums + 6
globalSumsIn(iSum) = globalSumsIn(iSum) + areaCell(iCell) * &
(snowVolumeCell(iCell) * rhos + iceVolumeCell(iCell) * rhoi)
(snowVolumeCell(iCell) * seaiceDensitySnow + iceVolumeCell(iCell) * seaiceDensityIce)

! average albedo
if (solarZenithAngleCosine(iCell) > 0.0_RKIND) then

iSum = (iRegion-1) * nSums + 7
globalSumsIn(iSum) = globalSumsIn(iSum) + &
areaCell(iCell) * &
(awtvdr * albedoVisibleDirectCell(iCell) + &
awtidr * albedoIRDirectCell(iCell) + &
awtvdf * albedoVisibleDiffuseCell(iCell) + &
awtidf * albedoIRDiffuseCell(iCell))
(seaiceAlbedoWtVisibleDirect * albedoVisibleDirectCell(iCell) + &
seaiceAlbedoWtNearIRDirect * albedoIRDirectCell(iCell) + &
seaiceAlbedoWtVisibleDiffuse * albedoVisibleDiffuseCell(iCell) + &
seaiceAlbedoWtNearIRDiffuse * albedoIRDiffuseCell(iCell))

iSum = (iRegion-1) * nSums + 8
globalSumsIn(iSum) = globalSumsIn(iSum) + &
Expand Down
Loading

0 comments on commit 511c002

Please sign in to comment.