Skip to content

Commit

Permalink
Merge branch 'MITgcm:master' into nc-grdchk+prof
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanaEscobar authored Jan 9, 2025
2 parents a7679ed + 83a5371 commit d8ab0d4
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
6 changes: 6 additions & 0 deletions doc/tag-index
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Notes on tags used in MITgcmUV
==============================

o utils/python:
- make MITgcmutils compatible with numpy 2.0.0 again.
o testreport:
- improve way of sending results tar file with "scp", now allowing to combine
"ssh" then "scp".

checkpoint69c (2024/12/06)
o pkg/mom_common,fluxform,vecinv:
- remove ISOTROPIC_COS_SCALING code from pkg/mom_vecinv/mom_vi_hdissip.F (was
Expand Down
8 changes: 4 additions & 4 deletions tools/do_tst_2+2
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ if test "x$ADDRESS" != xNONE -a "x$ADDRESS" != x ; then
fi
fi
if test "x$SENDCMD" != x ; then
SendOpt='' ; headCMD=`echo $SENDCMD | awk '{print $1}'`
if test $headCMD != 'scp' ; then SendOpt='-s MITgcm-test -m 3555000' ; fi
#echo " run: $SENDCMD $SendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
sendOpt='' ; nb=`echo $SENDCMD | grep -c '\<scp\>'`
if [ $nb -eq 0 ] ; then sendOpt='-s MITgcm-test -m 3555000' ; fi
#echo " run: $SENDCMD $sendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
&& gzip ${SAVDIR}/${DRESULTS}".tar" \
&& $SENDCMD $SendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESS
&& $SENDCMD $sendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESS
out=$?
if test "x$out" != x0 ; then
echo
Expand Down
4 changes: 2 additions & 2 deletions utils/python/MITgcmutils/MITgcmutils/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def pfromz(rC, rF0=0.0, lat=None, rhoConst=1.0275e+3, eosRefP0=1.01325e+5,
>>> pfromz(-1000,lat=[70,90])
1009.6304, 1010.2562
"""
z = np.asfarray(rC)
z = np.asarray(rC, dtype=np.float64)

assert np.all(z<=0), 'input_error: values cannot be positive'

if lat is None:
gravity = 9.81
else:
lat = np.asfarray(lat)
lat = np.asarray(lat, dtype=np.float64)
if lat.ndim == 1 and z.ndim == 1:
lat,z = np.meshgrid(lat,z)

Expand Down
49 changes: 25 additions & 24 deletions utils/python/MITgcmutils/MITgcmutils/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
def _check_salinity(s):

sneg = s<0
if not np.any(sneg):
warnings.warn('found negative salinity values, reset them to NaN')
# s[sneg] = np.NaN
if np.any(sneg):
warnings.warn('found negative salinity values')
# warnings.warn('found negative salinity values, reset them to nan')
# s[sneg] = np.nan

return s

Expand Down Expand Up @@ -105,8 +106,8 @@ def linear(salt,theta,
"""

# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)

_check_dimensions(s,t)

Expand Down Expand Up @@ -152,8 +153,8 @@ def poly3(poly3,salt,theta):
- Converted to python by Gavilan on 2024-07-18
"""
# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
coeffs=poly3[:,3:]


Expand Down Expand Up @@ -249,9 +250,9 @@ def jmd95(salt,theta,p):
"""

# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
p = np.asfarray(p)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

_check_dimensions(s,t,p)

Expand Down Expand Up @@ -299,9 +300,9 @@ def bulkmodjmd95(salt,theta,p):
""" Compute bulk modulus
"""
# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
p = np.asfarray(p)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

# coefficients in pressure coordinates for
# 3. secant bulk modulus K of fresh water at p = 0
Expand Down Expand Up @@ -424,9 +425,9 @@ def unesco(salt,theta,p):
"""

# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
p = np.asfarray(p)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

_check_dimensions(s,t,p)

Expand Down Expand Up @@ -473,9 +474,9 @@ def bulkmodunesco(salt,theta,p):
""" Compute bulk modulus
"""
# make sure arguments are floating point
s = np.asfarray(salt)
t = np.asfarray(theta)
p = np.asfarray(p)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

# 3. secant bulk modulus K of fresh water at p = 0
eosJMDCKFw = [ 1.965221e+04,
Expand Down Expand Up @@ -600,7 +601,7 @@ def mdjwf(salt,theta,p,epsln=0):
"""

# make sure arguments are floating point
s = np.asarray(s, dtype=np.float64)
s = np.asarray(salt, dtype=np.float64)
t = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

Expand Down Expand Up @@ -667,7 +668,7 @@ def mdjwf(salt,theta,p,epsln=0):
)

denom = 1.0/(epsln+den)
rho = rhoNum*denom
rho = num*denom

return rho

Expand Down Expand Up @@ -704,9 +705,9 @@ def teos10(salt,theta,p,epsln=0):
"""

# make sure arguments are floating point
sa = np.asfarray(salt)
ct = np.asfarray(theta)
p = np.asfarray(p)
sa = np.asarray(salt, dtype=np.float64)
ct = np.asarray(theta, dtype=np.float64)
p = np.asarray(p, dtype=np.float64)

_check_dimensions(sa,ct,p)

Expand Down
7 changes: 2 additions & 5 deletions utils/python/MITgcmutils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="MITgcmutils",
version="0.2",
version="0.2.1",
author="MITgcm Developers and Contributors",
author_email="[email protected]",
description="Python utilities for MITgcm",
Expand All @@ -19,8 +19,5 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=["numpy"],
extras_require={
"plot": ["matplotlib"],
}
install_requires=["numpy","matplotlib"],
)
10 changes: 4 additions & 6 deletions verification/testreport
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,6 @@ scandirs()
fi
}


check_eedata()
{
# check_eedata eedata size.h
Expand Down Expand Up @@ -1094,7 +1093,6 @@ check_eedata()

###############################################################################


# Default properties
debug=0
verbose=1
Expand Down Expand Up @@ -1907,14 +1905,14 @@ if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
echo "No results email was sent."
else
if test "x$SENDCMD" != x ; then
SendOpt='' ; headCMD=`echo $SENDCMD | awk '{print $1}'`
if test $headCMD != 'scp' ; then SendOpt='-s MITgcm-test -m 3555000' ; fi
sendOpt='' ; nb=`echo $SENDCMD | grep -c '\<scp\>'`
if [ $nb -eq 0 ] ; then sendOpt='-s MITgcm-test -m 3555000' ; fi
if [ $verbose -gt 1 ]; then
echo " run: $SENDCMD $SendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
echo " run: $SENDCMD $sendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
fi
tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
&& gzip ${SAVDIR}/${DRESULTS}".tar" \
&& $SENDCMD $SendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
&& $SENDCMD $sendOpt ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
RETVAL=$?
if test "x$RETVAL" != x0 ; then
echo
Expand Down

0 comments on commit d8ab0d4

Please sign in to comment.