Commit 42e7684d authored by Markus Pahlow's avatar Markus Pahlow

merge-in O_LGM options from Chia-Te

parent 0d1002a6
......@@ -77,12 +77,20 @@
if ( m .eq. itaux ) then
! x component of windstress
call get_tdsbc (n, 'O_tau.nc', 'O_tauX', itaux
# if defined O_LGM_wind
call get_tdsbc (n, 'O_tau.nc', 'O_TAUX', itaux
# else
call get_tdsbc (n, 'O_tau.nc', 'O_tauX', itaux
# endif
&, rdtdbc(n), c10, c0)
elseif ( m .eq. itauy ) then
! y component of windstress
call get_tdsbc (n, 'O_tau.nc', 'O_tauY', itauy
# if defined O_LGM_wind
call get_tdsbc (n, 'O_tau.nc', 'O_TAUY', itauY
# else
call get_tdsbc (n, 'O_tau.nc', 'O_tauY', itauY
# endif
&, rdtdbc(n), c10, c0)
elseif ( m .eq. iws ) then
......
......@@ -99,12 +99,18 @@
if ( m .eq. itaux ) then
if (k .eq. 1) print*, 'x component of windstress'
# if defined O_LGM_wind
call get_sbc (n, 'O_tau.nc', 'O_TAUX', id, im, c10, c0)
# else
call get_sbc (n, 'O_tau.nc', 'O_tauX', id, im, c10, c0)
# endif
elseif ( m .eq. itauy ) then
if (k .eq. 1) print*, 'y component of windstress'
# if defined O_LGM_wind
call get_sbc (n, 'O_tau.nc', 'O_TAUY', id, im, c10, c0)
# else
call get_sbc (n, 'O_tau.nc', 'O_tauY', id, im, c10, c0)
# endif
elseif ( m .eq. iws ) then
if (k .eq. 1) print*, 'surface wind speed'
call get_sbc (n, 'A_windsur.nc', 'A_windspd', id, im
......
......@@ -337,6 +337,19 @@
# if defined O_save_embm_diff
do n=1,nat
if (trim(mapat(n)) .eq. 'sat') then
# if defined O_LGM_humidity
call defvar ('A_DIFFTX2', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
&, 'eastward diffusion for temperature'
&, 'eastward_diffusion', 'm2 s-1')
call defvar ('A_DIFFTY2', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
&, 'northward diffusion for temperature'
&, 'northward_diffusion', 'm2 s-1')
elseif (trim(mapat(n)) .eq. 'shum') then
call defvar ('A_DIFFQX2', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
&, 'eastward diffusion for humidity'
&, 'eastward_diffusion', 'm2 s-1')
call defvar ('A_DIFFQY2', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
# else
call defvar ('A_difftX', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
&, 'eastward diffusion for temperature'
&, 'eastward_diffusion', 'm2 s-1')
......@@ -348,6 +361,7 @@
&, 'eastward diffusion for humidity'
&, 'eastward_diffusion', 'm2 s-1')
call defvar ('A_diffqY', iou, 3, iu, -c1e3, c1e3, ' ', 'F'
# endif
&, 'northward diffusion for humidity'
&, 'northward_diffusion', 'm2 s-1')
elseif (trim(mapat(n)) .eq. 'co2') then
......@@ -932,6 +946,16 @@
do n=1,nat
if (trim(mapat(n)) .eq. 'sat') then
tmpij(ils:ile,jls:jle) = de(ils:ile,jls:jle,n)
# if defined O_LGM_humidity
call putvara ('A_DIFFTX2', iou, ln, ib, ic, tmpij, c1e4, c0)
tmpij(ils:ile,jls:jle) = dn(ils:ile,jls:jle,n)
call putvara ('A_DIFFTY2', iou, ln, ib, ic, tmpij, c1e4, c0)
elseif (trim(mapat(n)) .eq. 'shum') then
tmpij(ils:ile,jls:jle) = de(ils:ile,jls:jle,n)
call putvara ('A_DIFFQX2', iou, ln, ib, ic, tmpij, c1e4, c0)
tmpij(ils:ile,jls:jle) = dn(ils:ile,jls:jle,n)
call putvara ('A_DIFFQY2', iou, ln, ib, ic, tmpij, c1e4, c0)
# elseif
call putvara ('A_difftX', iou, ln, ib, ic, tmpij, c1e4, c0)
tmpij(ils:ile,jls:jle) = dn(ils:ile,jls:jle,n)
call putvara ('A_difftY', iou, ln, ib, ic, tmpij, c1e4, c0)
......@@ -940,6 +964,7 @@
call putvara ('A_diffqX', iou, ln, ib, ic, tmpij, c1e4, c0)
tmpij(ils:ile,jls:jle) = dn(ils:ile,jls:jle,n)
call putvara ('A_diffqY', iou, ln, ib, ic, tmpij, c1e4, c0)
# endif
elseif (trim(mapat(n)) .eq. 'co2') then
tmpij(ils:ile,jls:jle) = de(ils:ile,jls:jle,n)
call putvara ('A_diffcX', iou, ln, ib, ic, tmpij, c1e4, c0)
......
......@@ -247,11 +247,17 @@
! northward component
vname = 'dn_'//trim(a3)
if (trim(mapat(n)) .eq. 'sat') then
vname = 'A_difftY'
# if defined O_LGM_humidity
vname = 'A_DIFFTY2'
elseif (trim(mapat(n)) .eq. 'shum') then
vname = 'A_diffqY'
vname = 'A_DIFFQY2'
# else
vname = 'A_difftY'
elseif (trim(mapat(n)) .eq. 'shum') then
vname = 'A_diffqY'
# endif
elseif (trim(mapat(n)) .eq. 'co2') then
vname = 'A_diffcY'
vname = 'A_diffcY'
endif
exists = inqvardef(trim(vname), iou)
if (exists) then
......@@ -263,9 +269,15 @@
! eastward component
vname = 'de_'//trim(a3)
if (trim(mapat(n)) .eq. 'sat') then
# if defined O_LGM_humidity
vname = 'A_DIFFTX2'
elseif (trim(mapat(n)) .eq. 'shum') then
vname = 'A_DIFFQX2'
# else
vname = 'A_difftX'
elseif (trim(mapat(n)) .eq. 'shum') then
vname = 'A_diffqX'
# endif
elseif (trim(mapat(n)) .eq. 'co2') then
vname = 'A_diffcX'
endif
......
......@@ -293,10 +293,17 @@
&, 'tracer_flux_'//trim(a3), 'unknown')
endif
enddo
# if defined O_LGM_wind
call defvar ('O_TAUX', iou, 3, iu, -c1e6, c1e6, ' ', 'F'
&, 'surface eastward momentum flux'
&, 'surface_downward_eastward_stress', 'Pa')
call defvar ('O_TAUY', iou, 3, iu, -c1e6, c1e6, ' ', 'F'
# else
call defvar ('O_tauX', iou, 3, iu, -c1e6, c1e6, ' ', 'F'
&, 'surface eastward momentum flux'
&, 'surface_downward_eastward_stress', 'Pa')
call defvar ('O_tauY', iou, 3, iu, -c1e6, c1e6, ' ', 'F'
# endif
&, 'surface northward momentum flux'
&, 'surface_downward_northward_stress', 'Pa')
# if defined O_rigid_lid_surface_pressure || defined O_implicit_free_surface
......@@ -1217,10 +1224,17 @@
enddo
tmpijm(ils:ile,jls:jle) = um(ils:ile,jls:jle,1)
tmpij(ils:ile,jls:jle) = taux(ils:ile,jls:jle)
# if defined O_LGM_wind
call putvaramsk ('O_TAUX', iou, ln, ib, ic, tmpij, tmpijm
&, c10, c0)
tmpij(ils:ile,jls:jle) = tauy(ils:ile,jls:jle)
call putvaramsk ('O_TAUY', iou, ln, ib, ic, tmpij, tmpijm
# else
call putvaramsk ('O_tauX', iou, ln, ib, ic, tmpij, tmpijm
&, c10, c0)
tmpij(ils:ile,jls:jle) = tauy(ils:ile,jls:jle)
call putvaramsk ('O_tauY', iou, ln, ib, ic, tmpij, tmpijm
# endif
&, c10, c0)
# if defined O_rigid_lid_surface_pressure || defined O_implicit_free_surface
tmpijm(ils:ile,jls:jle) = tm(ils:ile,jls:jle,1)
......
......@@ -810,8 +810,8 @@
# else
fesed = fetopsed*bct*redptn*expo*sgb
# endif
# if defined O_LGM_iron
! As for bdeni, also reduce sedimentary iron release from the sediment.
# if defined O_LGM
if (k .eq. 1) then
fesed = 0.0
else if (k .eq. 2) then
......@@ -821,7 +821,7 @@
bfe = fesed
snpzd(itdfe) = snpzd(itdfe) + fesed
if (t(i,k,j,io2,taum1) .lt. o2min) then
# if defined O_LGM
# if defined O_LGM_iron
! remineralise only the fraction of Fe as the assumed existence of the current grid cell
! this is 0 for k.eq.1 and 0.08 for k.eq.2
if (k .eq. 2) then
......@@ -833,7 +833,7 @@
snpzd(itdfe) = snpzd(itdfe) + expofe*sgb
bfe = bfe + expofe*sgb
expofe = expofe - sgb*expofe
# if defined O_LGM
# if defined O_LGM_iron
endif
# endif
endif
......@@ -919,8 +919,8 @@ c & bdeni = sgbdfac*bdeni
# else
fesed = fetopsed*bct*redptn*expo
# endif
! As for bdeni, also reduce sedimentary iron release from the sediment.
# if defined O_LGM
# if defined O_LGM_iron
! As for bdeni, also reduce sedimentary iron release from the sediment.
if (k .eq. 1) then
fesed = 0.0
else if (k .eq. 2) then
......@@ -930,7 +930,8 @@ c & bdeni = sgbdfac*bdeni
bfe = fesed
snpzd(itdfe) = snpzd(itdfe) + fesed
if (t(i,k,j,io2,taum1) .lt. o2min) then
# if defined O_LGM
# if defined O_LGM_iron
! Iron from sediment release in OMZ also reduced.
if (k .eq. 2) then
snpzd(itdfe) = snpzd(itdfe) + expofe*0.08
bfe = bfe + expofe*0.08
......@@ -940,7 +941,7 @@ c & bdeni = sgbdfac*bdeni
snpzd(itdfe) = snpzd(itdfe) + expofe
bfe = bfe + expofe
expofe = 0.
# if defined O_LGM
# if defined O_LGM_iron
endif
# endif
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment