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

Land mass #322

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SeasonalClimateFiles
*.hdf5
*.vscode
*.geography

#files created from running tests
*MP_Checkpoint*
Expand Down
28 changes: 15 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
GITVERSION := $(shell git describe --tags --abbrev=40 --always)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CC = gcc
GCC_FLAGS1 = -fPIC -Wl,-Bsymbolic-functions -c
GCC_FLAGS2 = -shared -Wl,-Bsymbolic-functions,-soname,vplanetlib.so
endif
ifeq ($(UNAME_S),Darwin)
CC = clang
GCC_FLAGS1 = -fPIC -c
GCC_FLAGS2 = -shared -Wl,-install_name,vplanetlib.so
endif
Expand All @@ -17,7 +19,7 @@ default:
-python setup.py develop

legacy:
-gcc -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
Expand All @@ -30,13 +32,13 @@ legacy:
@echo "=========================================================================================================="

debug:
-gcc -g -D DEBUG -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -g -D DEBUG -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

opt:
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
Expand All @@ -52,28 +54,28 @@ cpp:
g++ -o bin/vplanet src/*.c -lm -O3 -fopenmp -fpermissive -w -DGITVERSION=\"$(GITVERSION)\"

warnings:
-gcc -g -D DEBUG -Wunused-but-set-variable -Wunused-variable -Wfloat-equal -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC)-g -D DEBUG -Wunused-but-set-variable -Wunused-variable -Wfloat-equal -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

parallel:
gcc -o bin/vplanet src/*.c -lm -O3 -fopenmp -DGITVERSION=\"$(GITVERSION)\"
$(CC) -o bin/vplanet src/*.c -lm -O3 -fopenmp -DGITVERSION=\"$(GITVERSION)\"

profile:
-gcc -pg -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -pg -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

optprof:
-gcc -pg -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -pg -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"

sanitize:
-gcc -g -fsanitize=address -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -g -fsanitize=address -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

test:
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-$(CC) -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-pytest --tb=short

coverage:
-rm -f ./gcov/*.gcda ./gcov/*.gcno ./.coverage
-mkdir -p ./gcov
-cd gcov && gcc -coverage -o ./../bin/vplanet ./../src/*.c -lm
-cd gcov && $(CC) -coverage -o ./../bin/vplanet ./../src/*.c -lm
-python -m pytest --tb=short tests --junitxml=./junit/test-results.xml
-lcov --capture --directory ./gcov --output-file ./.coverage
-genhtml ./.coverage --output-directory ./gcov/html
Expand All @@ -82,8 +84,8 @@ docs:
-make -C docs html && echo 'Documentation available at `docs/.build/html/index.html`.'

shared:
-gcc ${GCC_FLAGS1} src/*.c
-gcc ${GCC_FLAGS2} -o bin/vplanetlib.so *.o -lc
-$(CC) ${GCC_FLAGS1} src/*.c
-$(CC) ${GCC_FLAGS2} -o bin/vplanetlib.so *.o -lc

clean:
rm -f bin/vplanet
Expand Down
71 changes: 71 additions & 0 deletions examples/ClimateLand/equatorial.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
sName equatorial #name of planet
saModules poise #what vplanet modules you want to use
sGeography equitorial
dLandWaterLatitude 16.4

dMass 3.00316726e-06 #mass of planet
dRadius -1.00 #radius (not important right now)
dRotPeriod -1.00000 #rotation period (minus = days)
dObliquity 23.5
dSemi 1
dEcc 0.0 #eccentricity of orbit
dLongP 0 #pericenter, wrt Earth's position at spring equinox
# note that this is the typical value +180,
# since that one is solar position
dDynEllip 0.0 #shape of planet (0 = a sphere)
dPrecA 0.0 #orientation of spin axis

#_______addition disorb/distrot parameters (leave these alone for now)__________________
#dInc 5e-5 #inclination of orbit
#dLongA 348.73936 #orientation of orbital plane
#bGRCorr 0 #use GR correction (not important)
#bInvPlane 1 #convert to invariable plane coords
#bOverrideMaxEcc 1 #override max ecc halt (not recommended)
#dHaltMaxEcc 0.4 #eccentricity at which to halt simulation

#_______poise parameters (have fun with these!)_________________________________________
iLatCellNum 151 #number of latitude cells
sClimateModel sea #use seasonal or annual model
dTGlobalInit 14.85 #initial guess at average surface temp
iNumYears 4 #number of years (orbits) to run clim model
iNStepInYear 80 #number of steps to take in a "year"
#dSurfAlbedo 0.35 #average surface albedo (annual model only)

#__ice params_________
bIceSheets 1 #enable ice sheets
dInitIceLat 90. #how low do initial ice sheet extend?
dInitIceHeight 0. #height of initial ice sheets
dIceDepRate 2.25e-5 #rate of snow build up (when T < 0)
dIceAlbedo 0.6 #albedo of ice
iIceDt 1 #time step of ice-sheet model (orbits)
iReRunSeas 500 #how often to re-run seasonal model
bSeaIceModel 0 #use sea ice model (slow!)
bSkipSeasEnabled 0 #can skip seasonal if snowball state present

#__heat diffusion______
#bMEPDiff 1 #calculate diffusion using max entropy production
#bHadley 1 #mimic hadley heat diffusion
dDiffusion 0.58 #diffusion coefficient (fixed)
dNuLandWater 0.8 #Heat diffusion coefficient between Land and Water

#__outgoing flux_______
dPlanckA 203.3 #offset for OLR calculation (greenhouse)
dPlanckB 2.09 #slope of OLR calc (water vapor feedback)
bCalcAB 0 #calculate A & B from Kasting model fits
#dpCO2 0.00028 #partial pressure of co2

#__surface properties__
dAlbedoLand 0.363 #albedo of land
dAlbedoWater 0.263 #albedo of water
dHeatCapLand 1.55e7 #land heat capacity
dHeatCapWater 4.428e6 #water heat capacity
dMixingDepth 70 #mixing depth of ocean


#________output options!_____________________________________________
saOutputOrder Time PrecA -TGlobal AlbedoGlobal -FluxOutGlobal $
-TotIceMass -TotIceFlow -TotIceBalance DeltaTime AreaIceCov Snowball Obliq $
IceBeltLand IceBeltSea Ecce

saGridOutput Time -Latitude -TempLat AlbedoLat -AnnInsol -FluxIn -FluxOut IceMass -IceHeight DIceMassDt $
-IceFlow -BedrockH -TempMaxLat -TempMinLat -FluxMerid -DivFlux
Loading
Loading