Code Refactoring

From Interactive System for Ice sheet Simulation
Jump to: navigation, search

Contents

Overview

Glimmer makes heavy use of model instance derived types, complicating code. We are re-factoring the subroutines and functions in glide_thck, glide_temp, and glide_velo so that instead of passing glide_global_type, we pass only the data elements that are used.

List of Subroutines to be Re-factored

High priority subroutines

thck_nonlin_evolve

Low priority subroutines

stagleapthck

init_temp

init_thck

init_velo

Signatures of Re-factored Subroutines

Subroutines and function who previously used model type

findvtri

findvtri_init

findvtri_rhs

wvel_ew

hadval

finddisp

slipvelo

calc_basal_shear

calcbmlt

calc_btrc

calcbwat

thck_evolve

thck_lin_evolve

timeevoltemp

Subroutines and functions that previously used subtypes of model

calcflwa

flohadvpnt

timeders

velo_calc_velo

vertintg

velo_calc_diffu

chckwvel

velo_integrate_flwa

zero_velo

gridwvel

wvelintg

variables passed to functions

calcflwa

variables passed to function before refactoring

model%numerics
model%temper%flwa
model%temper%temp
model%geometry%thck
model%paramets%flow_factor
model%options%whichflwa

variables passed to function after refactoring

fohadvpnt

variables passed to function before refactoring

model%tempwk
uvel 
vvel
tempx
tempy
iteradvt
diagadvt
note: this function is not currently called by anything in glimmer

variables passed to function after refactoring

timeders

variables passed to function before refactoring

model%thckwk,   &
model%geometry%thck,     &
model%geomderv%dthckdtm, &
model%geometry%mask,     &
model%numerics%time,     &

variables passed to function after refactoring

velo_calc_velo

variables passed to function before refactoring

model%velowk
model%geomderv%stagthck
model%geomderv%dusrfdew
model%geomderv%dusrfdns
model%temper%flwa
model%velocity%diffu
model%velocity%ubas
model%velocity%vbas
model%velocity%uvel
model%velocity%vvel
model%velocity%uflx
model%velocity%vflx

variables passed to function after refactoring

vertintg

variables passed to function before refactoring

model%velowk
2nd parameter varies

variables passed to function after refactoring

velo_calc_diffu

variables passed to function before refactoring

model%velowk
model%geomderv%stagthck
model%geomderv%dusrfdew
model%geomderv%dusrfdns
model%velocity%diffu

variables passed to function after refactoring

chckwvel

variables passed to function before refactoring

model%numerics
model%geomderv 
model%velocity%uvel
model%velocity%vvel
model%velocity%wvel
model%geometry%thck
model%climate% acab

variables passed to function after refactoring

velo_integrate_flwa

variables passed to function before refactoring

model%velowk
model%geomderv%stagthck
model%temper%flwa

variables passed to function after refactoring

zero_velo

variables passed to function before refactoring

model%velowk
model%numerics%sigma
model%geomderv%stagthck
model%geomderv%dusrfdew
model%geomderv%dusrfdns
model%temper%flwa
model%velocity%ubas
model%velocity%vbas
model%velocity%uvel
model%velocity%vvel
model%velocity%uflx
model%velocity%vflx
model%velocity%diffu

variables passed to function after refactoring

gridwvel

variables passed to function before refactoring

model%numerics%sigma
model%numerics%thklim
model%velocity%uvel
model%velocity%vvel
model%geomderv
model%geometry%thck
model%velocity%wgrd

variables passed to function after refactoring

wvelintg

variables passed to function before refactoring

model%velocity%uvel
model%velocity%vvel
model%geomderv
model%numerics
model%velowk
model%velocity%wgrd
model%geometry%thck
model%temper%bmlt
model%velocity%wvel)

variables passed to function after refactoring

findvtri

variables passed to function before refactoring

model 
GLIDE_IS_FLOAT(model%geometry%thkmask(ew,ns)))

variables passed to function after refactoring

findvtri_init

variables passed to function before refactoring

model
model%temper%temp(:,ew,ns)
model%geometry%thck(ew,ns)
GLIDE_IS_FLOAT(model%geometry%thkmask(ew,ns)))

variables passed to function after refactoring

findvtri_rhs

variables passed to function before refactoring

model
model%climate%artm
GLIDE_IS_FLOAT(model%geometry%thkmask(ew,ns))

variables passed to function after refactoring

wvel_ew

variables passed to function before refactoring

model

variables passed to function after refactoring

hadvall

variables passed to function before refactoring

model
model%temper%temp
model%geometry%thck

variables passed to function after refactoring

finddisp

variables passed to function before refactoring

model
model%geometry%thck
model%geomderv%stagthck
model%geomderv%dusrfdew
model%geomderv%dusrfdns
model%temper%flwa

variables passed to function after refactoring

slipvelo

variables passed to function before refactoring

model
model%velocity%btrc
model%velocity%ubas
model%velocity%vbas

variables passed to function after refactoring

calc_basal_shear

variables passed to function before refactoring

model

variables passed to function after refactoring

calcbmlt

variables passed to function before refactoring

model
model%temper%temp
model%geometry%thck
model%geomderv%stagthck
model%geomderv%dusrfdew
model%geomderv%dusrfdns
model%velocity%ubas
model%velocity%vbas
model%temper%bmlt
GLIDE_IS_FLOAT(model%geometry%thkmask)

variables passed to function after refactoring

calc_btrc

variables passed to function before refactoring

model
model%options%whichbtrc
model%velocity%btrc

variables passed to function after refactoring

calcbwat

variables passed to function before refactoring

model
model%options%whichbwat
model%temper%bmlt
model%temper%bwat
model%geometry%thck
model%geometry%topg
model%temper%temp(model%general%upn,:,:)
GLIDE_IS_FLOAT(model%geometry%thkmask))

variables passed to function after refactoring

thck_evolve

variables passed to function before refactoring

model
rest variables varied

variables passed to function after refactoring

thck_lin_evolve

variables passed to function before refactoring

model
model%temper%newtemps

variables passed to function after refactoring

timeevoltemp

variables passed to function before refactoring

model
model%options%whichtemp

variables passed to function after refactoring